09 Dec Joins in Tableau
Joins in Tableau are used to combine data from multiple tables based on a common column. Let us understand with some examples. We will begin with the types of joins supported in Tableau.
Types of Joins
- Inner Join: Returns only the rows that have a match in both tables.
- Left Join: Returns all the rows from the left table and the matching rows from the right table.
- Right Join: Returns all the rows from the right table and the matching rows from the left table.
- Full Outer Join: Returns all the rows from both tables, with nulls where there are no matches.
The below figure represents the same:
How to create Joins in Tableau
Let us create Joins. Open Tableau, create a new Tableau Workbook, and save it. We have saved it and given it the name Amit_Tableau_Joins.twb.
We connected the data and added the Sample – Superstor.xlsx.
Note: The Data Connection can be in the same data source (such as tables in a database or sheets in an Excel spreadsheet) or different data sources (this is known as a cross-database join). If you combined tables using a cross-database join,
First, we dragged the Orders table only to the canvas:
We successfully dragged:
Now, we will drag the People table also from the left. While dragging, a line will be visible displaying that the two tables are being joined.
This will combine both People and the Orders table with Joins:
As you can see, based on the column Region, both the tables have been joined:
Now, let us get records from both the tables.
For that, click on Sheet 1 below and create a new sheet. On the left, we can now see the fields of both tables:
Let us get the regional managers for the states. Drag the State column from the Orders table to the Rows shelf. After that, drag the Regional Manager column from the People table to the Rows shelf:
Now, the list of the Regional Managers is visible by joining both tables.
If you liked the tutorial, spread the word and share the link and our website Studyopedia with others.
For Videos, Join Our YouTube Channel: Join Now
Read More:
No Comments