Join is a query that combines the data from 2 or more tables, sheets, files in a single datasource based on the join condition

Desired to gain proficiency on data visualization tool? Explore the blog post on Tableau Training to become a pro in Tableau.

Rules to perform Join:
To perform Join we are having two rules
1) Both the tables should have a common column
2) Based on the common data type in the both tablesJoin Types:
Depending on the join condition. Joins are divided into two types
1) Equi Joins
2) Non-Equi Joins
Equi Joins: In the Join condition if you use the equality operator (“=”) then such a kind of Join is called as “ Equi Join”
Non-Equi Joins: In the Join condition apart from the equality if we use any operator like <,>,<>,<=,>= etc.
Suck kind of join is known as “Non-equi Join”
Equi Join Types:
Equi Join is divided into 3 types
1. Inner Join
2. Outer Join
3. Self Join
Again outer join is divided into 3 different types
1. Left Outer
2. Right Outer
3. Full Outer
Inner Join:
Inner Join combines the data from two tables and it display only the matching records (or) common records.

To perform Join we are having two rules 1) Both the tables should have a common column 2) Based on the common data type in the both tablesJoin Types: Depending on the join condition. Joins are divided into two types 1) Equi Joins 2) Non-Equi Joins Equi Joins: In the Join condition if you use the equality operator (“=”) then such a kind of. In order to analyze two tables together, you can join the two tables using a common field. When you combine tables using a join, you can view and use the data from both tables in your analysis. The Default Inner Join when you join two tables together, Tableau will default to the inner join type. The below diagram illustrates the inner join.

Join Condition: Table1.ID=Table2.ID

Table 1:

NameID
Ramesh1
Ravi2
Praveen3
Kiran4

Table 2:

IDDesigntion
1Professor
2Professor
3Professor
4Principal

Output:

NameDesignation
RameshProfessor
RaviProfessor
PraveenProfessor


Outer Join
Left Outer Join:
Is is display the complete data from the left table and matching records from the the Right Table.

Table1.ID=Table2.ID(+)

Following Above Table 1 & Table 2

Output:

NameDesignation
RaviProfessor
RameshProfessor
PraveenProfessor
KiranNull

Tableau Merge Columns

Right Outer Join:
It is display complete data from right table and matching records from left table.

Table1.ID(+)=Table2.ID

Following Above Table 1 & Table 2

Output:

NameDesignation
RameshProfessor
RaviProfessor
PraveenProfess
NullPrincipal

Full Outer Join:
It displays the complete data from both the tables

Following Above Table 1 & Table 2

Output:

NameDesignation
RameshProfessor
RaviProfessor
PraveenProfessor
KiranNull
NullPrincipla

Self Join:
Performing a join to the same table itself is known as “Self Join”

Explore Tableau Sample Resumes! Download & Edit, Get Noticed by Top Employers!Download Now!

Joining Tables

Many relational data sources are made up of a collection of tables that are related by specific fields. For example, a data source for a publisher may have a table for authors that contains the first name, last name, phone number, etc. of clients.

In addition, there may be another table for titles that contains the price, royalty, and title of published books. In order to analyze these two tables together, to answer questions like, how much was paid in royalties last year for a particular author, you would join the two tables using a common field such as Author ID. That way you can view and use the fields from both tables in your analysis.

Adding Tables

Join Two Tables In Tableau

How To Join Two Tables In Tableau

Join Two Tables In Tableau

You can connect to multiple tables when you first connect to a data source using the connection dialog box. There you can add tables, specify joins, and modify the field aliases in the case you have similarly named fields in each of the tables.

You can also add tables after you have already connected to the data source. This section describes how to connect to multiple tables as well as adding tables to the Data window.

Connecting to Multiple Tables

Select the table or view you want to start with (typically the fact table) and then select the Multiple Tables option.

Click the Add New Table button at the bottom of the dialog box.

In the Add Table dialog box select a table to add to the Data window.

Optionally change Field aliases.

SourcesJoin

In the bottom half of the Add Table dialog box, there is a list of fields with their aliases. Double-click the field alias to change how the field will be displayed in the Data window. This is often useful when you have duplicate field names across tables or your field names are not very understandable.

Add a join by selecting the Join tab.

Tableau will automatically create a join for you based on the structure of your data. Select the Joins tab to inspect the join clause to make sure it is how you want to connect the tables.

You can delete unwanted join clauses by selecting it in the list of join clauses and clicking Delete

In the Join pane, add one or more join clauses by selecting a field from the original table, a field from the added table, and an operator. Then click Add to add it to the list of Join Clauses.

For example, in a data source that has a table of order information and another for users information, you could join the two tables based on the Region field that exists in both tables. Select Region in both the lists of fields, select the equal sign as the operator, and click Add.

Select the type of join from the Join Type drop-down list. You can select Inner, Left, or Right.

Please note, you cannot nest Inner joins within Left or Right joins. These joins will cause a join expression not supported error.

When finished, click OK.

The tables are listed in the Connection dialog box along with the foreign keys.

Complete the connection by giving it a name and clicking OK.

When you add joined tables, the Data window is automatically organized to use the Group by Table command. You can turn this feature off or change how the Data window is sorted using the Data window menu.

Adding Tables to the Data window

Select a data source on the Data menu and then select Edit Tables.

Tableau Join Calculation

In the Tables dialog box, click Add New Table.

In the Add Tables dialog box, select a table to add. Complete the dialog box by defining at least one join clause and optionally changing field aliases.

When finished, click OK and then OK again to close the dialog boxes.

Join Two Tables In Tableau

When you connect to multiple tables you are essentially connecting to a denormalized view of the data source. This means that all queries are run against all tables and it is possible for some measures to be over counted.

For example, suppose you have an employees table and an orders table. However you keep the employee salary measure in the orders table. The salary will be counted for each order the employee made. Use the MIN aggregation to remove the double counting.

Editing Tables

You can modify the joined tables using the Tables command. You may want to edit a table to add or remove fields from the Data window, modify the join clause, or add more join clauses to further define how the table is connected to the original table.

Select a data source on the Data menu and then select Edit Tables.

In the Tables dialog box, select the joined table you want to modify and click Edit.

In the subsequent dialog box, you can change the table and field aliases as well as add and remove fields from the Data window. Select the Join tab to edit the join clauses.

Tableau Union

When finished click OK twice to close the Tables dialog boxes.

Tableau Prep Join Types

For indepth knowledge on Tableau, click on below

Coments are closed

Most Viewed Posts

  • Walmart Track My Order
  • Microsoft Planner In Teams
  • Combine 2 Fields In Excel
  • Google Drive File Stream Is Full

Scroll to top