Data Analytics8 min read

Joining Data: When Two Become One

How linking datasets together tells a more complete story -- and why this skill matters more than you think.

Joining Data: When Two Become One

Most real analysis questions need more than one table. In so many situations, data from web analytics, email campaigns, sales data, advertising, and more need to be stitched together to tell as complete a story as possible for return on investment and understanding performance.

Why This Matters

I've seen agencies not get paid until they can link their advertisements and affiliate data to actual website and call orders minus returns. Once you can make that story clear, it opens up trust and confidence in higher marketing spend.

The ability to join data isn't just a technical skill -- it's the bridge between "here's what we spent" and "here's what we got back."

What Is SQL?

(Structured Query Language) is a simple programming-like language that lets you select database information -- think of choosing which columns and which rows, arranged in the way you ask. It's often used even by non-technical business people like marketers at Amazon.

Plenty of tools (Tableau, Looker Studio, Power BI, even spreadsheets) do joins for you without writing SQL. Understanding the concepts still helps you make sure you have the data you need, and it impresses in places you wouldn't expect.

Where SQL Shows Up (Surprise Interview Questions)

  • Non-technical product management at Amazon
  • Project management roles at agencies
  • Marketing brand manager positions

Keep this handy before interviews. It comes up more than you'd think.

Understanding Data Relationships

When you join two tables, you're connecting them through a -- usually an ID column that exists in both. The join tells Tableau (or SQL) how to match rows from one table to rows in the other.

The Core Join Types

Select a join type below to see how it works visually. Watch which rows get included and which get excluded:

Interactive

SQL Join Explorer

EmailCampaignsPurchaseDataBoth101, 103

Inner Join

Only rows where the key exists in both tables

Keeps: Matched rows only

Left Table: Email Campaigns

CustomerIDEmailOpened
101YesYes
102YesNo
103YesYes

Right Table: Purchases

CustomerIDProductAmount
101Shoes$89
103Jacket$145
104Hat$32

Result: Inner Join

2 rows

IDEmailOpenedProductAmount
101YesYesShoes$89
103YesYesJacket$145

Only customers who were emailed AND purchased

-- Only keeps rows where the ID exists in both tables. If a customer appears in your orders table but not your email table, they're excluded. This is the most common and the safest default.

-- Keeps all rows from the first (left) table, and matches from the second where possible. If there's no match, the second table's columns show as null. Use this when you want to keep your full base dataset and enrich it with additional data.

Right Join -- The reverse of a left join. Keeps all rows from the second (right) table. Less commonly used -- you can usually restructure as a left join instead.

-- Keeps everything from both tables, matched where possible, nulls where not. Use this when you need the complete picture from both sources, even if some records don't overlap.

The Key Field

The field you join on must exist in both tables and represent the same thing. Customer ID, email address, order number -- whatever uniquely identifies a record across both datasets. If the key doesn't match cleanly (different formats, missing values, duplicates), your join will produce bad results. Data cleaning before joining is essential.

Doing This Without SQL

In a BI tool like Tableau, you don't write SQL. You drag tables onto the canvas, and Tableau detects potential join fields automatically. You can:

  1. Drag two data sources onto the data pane
  2. Click the join icon between them
  3. Select the join type (inner, left, right, full outer)
  4. Confirm the key field(s)

Tableau also supports relationships (a newer, more flexible approach) that automatically determine the right join type based on how you use the fields in your visualization. For most everyday marketing analysis, either approach works.

Why You'll Thank Me Later

This can feel abstract until the moment you need to connect ad spend data to conversion data, link survey responses to purchase behavior, or combine social media metrics with website analytics. Joins are what make that possible.

Every analyst who's been stuck staring at two spreadsheets that should talk to each other but don't? They wished they understood joins sooner.