0
0
Tableaubi_tool~5 mins

Union and join basics in Tableau - Step-by-Step Guide

Choose your learning style9 modes available
Introduction
This feature helps you combine data from multiple tables or files in Tableau. You can stack data with a union or connect data side-by-side with a join. It solves the problem of working with related data spread across different sources.
When you have monthly sales data in separate Excel files and want to analyze all months together.
When you want to combine customer information from two different databases into one view.
When you need to add product details to your sales transactions by matching product IDs.
When you want to see all records from two tables, even if some don’t match.
When you want to filter or analyze data that comes from different sources but shares common fields.
Steps
Step 1: Open Tableau and connect to your first data source
- Start page β†’ Connect pane
The data source appears in the Data pane on the left
πŸ’‘ Use Excel, CSV, or database connections depending on your data
Step 2: Drag the first table or file to the canvas in the Data Source tab
- Data Source tab β†’ canvas area
The table appears as a data grid on the canvas
Step 3: To create a union, drag the second table or file directly below the first one until you see a 'Union' option
- Data Source tab β†’ canvas area below first table
Tables stack vertically and show combined rows from both tables
πŸ’‘ Tables must have similar columns for a clean union
Step 4: To create a join, drag the second table next to the first one on the canvas
- Data Source tab β†’ canvas area next to first table
A join icon appears between tables showing how they connect
πŸ’‘ Select the join type (Inner, Left, Right, Full Outer) by clicking the join icon
Step 5: Click the join icon to set join keys by selecting matching fields from each table
- Join configuration popup
Tables connect based on the selected fields, filtering data accordingly
Step 6: Review the preview data grid to confirm the union or join worked as expected
- Data Source tab β†’ data preview area
You see combined data rows for union or merged columns for join
Before vs After
Before
Two separate tables: one with 100 sales records, another with 50 product details
After
One combined table showing 150 rows stacked (union) or 100 rows with product info added (join)
Settings Reference
Join Type
πŸ“ Join icon on Data Source canvas
Controls which rows appear based on matching keys between tables
Default: Inner
Union Tables
πŸ“ Drag tables vertically on Data Source canvas
Stacks tables to combine rows from multiple sources
Default: Manual union by dragging
Join Keys
πŸ“ Join configuration popup
Defines how tables relate by matching column values
Default: None
Common Mistakes
Trying to union tables with different column names or orders
Union stacks rows but requires similar columns to align data correctly
Rename or reorder columns in source files to match before union
Using the wrong join type and losing data unintentionally
Inner join removes unmatched rows, which may hide important data
Choose Left or Full Outer join if you want to keep all records from one or both tables
Not selecting join keys correctly, causing incorrect data matches
Join keys must match the fields that relate the tables logically
Carefully select matching columns like Customer ID or Product ID for join keys
Summary
Union stacks data tables vertically to combine rows with similar columns.
Join connects tables side-by-side based on matching fields to combine columns.
Choose the right join type and matching keys to avoid losing or mismatching data.