Tableau Blend vs Join: Targets Against Sales Walkthrough
SQL & DataModel answerLast updated
Work out exact join and blend results on two small tables, then explain how filter order, fan-out and granularity change the numbers and when blending is the better choice.
A sales analyst is comparing actual sales to targets in Tableau. There are two small tables.
Orders (the primary source): OrderID, State, Category, Sales
| OrderID | State | Category | Sales |
|---|---|---|---|
| O1 | CA | Furniture | 100 |
| O2 | CA | Office Supplies | 200 |
| O3 | NY | Technology | 150 |
| O4 | TX | Furniture | 300 |
| O5 | CA | Technology | 50 |
Targets (the secondary source): State, Category, MonthlyTarget
| Row | State | Category | MonthlyTarget |
|---|---|---|---|
| A | CA | Furniture | 500 |
| B | CA | Technology | 400 |
| C | NY | Furniture | 250 |
| D | FL | Technology | 600 |
Answer each part with exact numbers and a short reason.
- Joins. Physically join the tables on State and Category. Which rows survive an inner join, and what are
SUM(Sales)andSUM(MonthlyTarget)per State/Category? Repeat for a left join from Orders to Targets. - Blend. Blend Targets into Orders, with Orders as primary and State and Category on Rows. Walk through how Tableau builds the view. How do the unmatched combinations (NY–Technology, TX–Furniture, FL–Technology) appear, and are the missing values null or zero?
- Filters. Show how the results change, and why, given Tableau's order of operations, for each of these:
- (a) a dimension filter
Category = 'Furniture'taken from Orders - (b) the same filter taken from Targets
- (c) a context filter
State = 'CA'on Orders - (d) a measure filter
SUM(Sales) > 150on the view - (e) a data source filter on Targets keeping
Category IN ('Furniture','Technology')
- (a) a dimension filter
- Pitfalls. Describe two situations where a blend and a join give different aggregates (level of detail, many-to-many matches, duplicate keys). Give a concrete example from this data.
- Judgment. When would you choose a blend over a join? Cover cross-database needs, required granularity, how the linking field behaves, performance and caching, and limits on calculations (FIXED LODs, table calcs) that involve the secondary source.
Hints
Hint 1
A join combines rows first and aggregates afterwards. A blend aggregates each source separately at the level of the linking fields, then attaches the secondary result to the primary marks.
Hint 2
In a blend only the primary source creates marks, so secondary-only combinations such as FL–Technology can never appear. Also ask what a filter on a secondary field does to rows where that field is null.
Hint 3
For the pitfalls, count how many target rows match each order when the join key is coarser than the data (join on State only), and ask which link fields are actually active when only State is in the view.
Model answer
Hard Try it yourself first — then compare your approach, complexity and edge cases.
Core idea
- A join matches rows first and aggregates afterwards.
- A blend aggregates each source on its own, then attaches the secondary result to the primary's marks.
- Filters run in a fixed order, and that order explains most of the surprising numbers.
1) Physical joins on State + Category
Inner join keeps only orders that have a matching target row:
| State | Category | SUM(Sales) | SUM(MonthlyTarget) |
|---|---|---|---|
| CA | Furniture | 100 | 500 |
| CA | Technology | 50 | 400 |
O2, O3 and O4 have no target. Targets C and D have no order. All five are dropped.
Left join (Orders → Targets) keeps every order and nulls the missing targets:
| State | Category | SUM(Sales) | SUM(MonthlyTarget) |
|---|---|---|---|
| CA | Furniture | 100 | 500 |
| CA | Office Supplies | 200 | null |
| CA | Technology | 50 | 400 |
| NY | Technology | 150 | null |
| TX | Furniture | 300 | null |
NY–Furniture and FL–Technology never show up, because a left join keeps only Orders' rows.
2) The blend
Tableau works in four steps:
- It queries Orders grouped by the view's dimensions (State, Category) and gets
SUM(Sales). - It queries Targets grouped by the active linking fields. State and Category link automatically because the names match, and they are active because they are in the view.
- It left-joins the two small result sets in memory, with the primary on the left.
- It draws marks only for primary members. Secondary values attach where the link values match.
The output equals the left-join table above.
- NY–Technology and TX–Furniture appear with sales of 150 and 300. Their target is null (a blank cell), not 0. Tableau does not invent zeros. Wrap the measure in
ZN(SUM([MonthlyTarget]))if you want 0. - FL–Technology (600) and NY–Furniture (250) are absent. A secondary-only member cannot create a mark.
If Category were not an active link and only State were linked, the targets would be summed per State and repeated on each row: CA = 900, NY = 250, TX = null.
3) Filters and order of operations
The order is: extract filters, data source filters, context filters, FIXED LODs, dimension filters, INCLUDE/EXCLUDE LODs, measure filters, table calculations.
(a) Category = Furniture, from Orders
- Blend or left join: CA–Furniture 100 / 500 and TX–Furniture 300 / null.
- Inner join: only CA–Furniture 100 / 500.
- The filter trims the primary rows, and the secondary is matched only to the marks that remain.
(b) Category = Furniture, from Targets
- A filter on a secondary field keeps only marks whose matched secondary value passes. TX–Furniture has a null secondary Category, so it is removed.
- Result: only CA–Furniture 100 / 500. This acts like an inner join on that field unless you also keep nulls.
- A left join behaves the same way, because
Targets.Categoryis null on unmatched rows. - Rule of thumb: filter on the side that owns the rows you want to keep.
(c) Context filter State = CA, on Orders
- Result: CA–Furniture 100 / 500, CA–Office Supplies 200 / null, CA–Technology 50 / 400.
- Here it looks like an ordinary dimension filter. The difference shows up for things computed after context: Top N, conditional filters and FIXED LODs. For example,
{FIXED [State] : SUM([Sales])}would see only CA (350) and no other states.
(d) Measure filter SUM(Sales) > 150
- It runs after aggregation at the view's level of detail.
- Blend or left join: CA–Office Supplies (200) and TX–Furniture (300) remain. NY–Technology (150) fails because the test is strict.
- Inner join: the view is empty, since the surviving rows have only 100 and 50.
(e) Data source filter on Targets: Category IN (Furniture, Technology)
- In a blend, every Targets row already qualifies, so nothing changes.
- On a joined source, the filter applies to the joined result. Rows with a null
Targets.Categoryare removed, which turns the left join into an inner join, as in (b).
4) Where blends and joins disagree
Pitfall 1: fan-out from a coarse or duplicated key.
Join on State only. Each of the 3 CA orders matches each of the 2 CA target rows (A and B), giving 6 rows:
| Approach | CA Sales | CA Target |
|---|---|---|
| Join on State | 2 × 350 = 700 | 3 × 900 = 2700 |
| Blend on State | 350 | 900 |
Duplicate keys do the same thing. If Targets held CA–Furniture twice at 500, a join on State + Category would count O1 twice: sales 200 (wrong) and target 1000. A blend would give sales 100 and target 1000, because sales are aggregated in their own query.
Pitfall 2: granularity of the link.
Put only State in the view:
| Approach | NY result |
|---|---|
| Blend (only State is an active link) | Sales 150, target 250 (the NY–Furniture target attaches even though NY sold no furniture) |
| Left join on State + Category, rolled up to State | Sales 150, target null |
| Inner join on State + Category | NY and TX do not appear at all |
Each answer is defensible for a different question. The point is to choose the one that matches the business meaning.
5) When to blend
- Cross-database or ungovernable sources. Blend when the data cannot be joined in one query, such as a published data source you cannot edit, or sources on different platforms.
- Different granularity. Blend when the secondary data is coarser (targets per state and category against order-level sales). Aggregating before matching avoids fan-out. In current Tableau versions, relationships (the logical layer) usually handle this better and should be the default choice where available.
- Linking field behavior.
- Links are left-join-like and primary-driven.
- Links are active only when the field is in the view, or when you enable it explicitly.
- Field names must match, or you define a custom link.
- Secondary dimensions that are not linked show
*when several values collide.
- Performance and caching. A blend runs one query per source and merges the small aggregated results in memory. It is cheap when the secondary is small and the link has low cardinality. It degrades with very high-cardinality links, and results cannot be pushed down as one query. A join is a single pushed-down query, can be extracted, and is easy to cache, but it can explode row counts.
- Calculation limits.
- Fields from the secondary can be used only as aggregates in the view.
- You cannot write a row-level calculation mixing primary and secondary fields.
- A FIXED LOD built in the secondary is computed at the secondary's own grain and is only then aggregated across the link. It cannot reference primary fields.
- Table calculations run on the blended result in the view, after everything else.
- Non-additive aggregates (COUNTD, MEDIAN) on secondary fields are restricted or unsupported in some cases.
Common mistakes
- Expecting zeros instead of nulls for unmatched members.
- Filtering on the secondary field and unknowingly turning the blend or left join into an inner join.
- Joining at a coarser key than the data and trusting the inflated sums.
- Assuming a secondary-only member (FL–Technology) will appear in a blend.