I wrote this post while listening to this song. Hit the play button and enjoy!
We will see how to Join two files in Tableau Desktop
It is often necessary to combine data from multiple places—different tables or even data sources—to perform a desired analysis. Depending on the structure of the data and the needs of the analysis, there are several ways to combine the tables.
Today we will see how to Join two files in Tableau Desktop. We can also "stack" files using Union, but this is a topic for another post.
- Creating a Join
Step 1: To create a join, connect to the relevant data source. These can be in the same data source (such as tables in a database or sheets in an Excel spreadsheet) or different data sources. Then, drag the first table to the canvas.
Step 2: double-click the first table - ''Book'' in this case - to open the join canvas and drag another table to the join canvas.
Step 3: Click the join icon to configure the join. Add one join clauses by selecting a common field - in this case "Book ID" is a column present in both sheets.
Note: You can also join files from another data source. If that's your case then click on Connections, click the Add button to add a new connection to the Tableau data source. With that connection selected, drag the desired table to the join canvas.
Step 4: Close the Join Canvas and IT'S DONE!! You can see below there are the two files combined in the same sheet now. You can hide one of the common columns.
- Creating a Join Calculation
Ok, that was easy to do it and useful - but what if the file I want to join doesn't match the field from the other sheet?
Then, we can use Join Calculation!
Go ahead and click on icon and then "Create Join Calculation".
The Join Calculation window will open, then add your formula as you desired.
In this case: In "Info" sheet the "Book ID" field is divided in "Book ID1" and "Book ID 2". So all we need to do is combine these two field to match the "Book ID" field from the "Book" sheet.
Click OK and close the join canvas and IT'S DONE!
As you could see, we have some different types of joins (right, left, inner and full outer). I covered this topic in this post.
Try to join your data files and If you have any question, just drop me a message!
- For more tips, you can follow me on LinkedIn.
- You can check out my portfolio on my Tableau Public.
- Time to relax! Add to your playlist the new Jack Johnson's album - Meet the Moonlight (2022).