Joining Tables
1. Table joins
>> 4 types of joins in Tableau
- inner joins (default)
- left joins
- right joins
- full outer joins
>> How to join tables?
Two situations :
-
Join tables in the same data database
-
Join tables in different databases
Connecting to multiple databases:
- blue: primary database
- orange: secondary database
How to join tables?
-
Connect to the relevant data source or sources
-
Drag the first table to the canvas
-
Select [Open] from the menu or double-click the first table to open the join canvas
-
Double-click or drag another table to the join canvas
-
Select a join type --> Add one or more join clauses
2. Joining Tables Using Calculations
>> When we use Join calculations?
Join calculations are typically used to fix mismatched field types, or just a mismatch in the values in the two tables when adding the join clause.
We can use Join calculation to create a new field that match the field use for join clause in the other table
[Example]
We have [Name] field in table A, [First Name] and [Last Name] fields in table B. To join these two tables:
-
Use Join calculation to create a new field “[Name]” for table B, which will be used for matching the [Name] field in table A
-
Join calculation function:
[First Name] + " " + [Last Name]