Tableau Desktop: Relationships vs. Joins

Relationships

Relationships are the initial go-to when connecting data sources in Tableau. They describe how two, independent, logical tables are related to each other (the tables are not merged).

Represented by noodles between logical tables. Relationships are present and displayed in the logical layer of Tableau's data model. Tableau will connect tables automatically based on matching data fields, or we can select which particular fields we want to join.

Two tables connected by a noodle. Tableau's logical layer. 

Benefits of Relationships
- Relationships maintain the same level of detail in the data sources.
- All measures are kept, even the ones that don’t match. unlike with joins, in which some measures get filtered. All rows and columns in the data sources are still readily available. Joins will sometimes duplicate data stored at differing levels of detail.
- They do not require us to select a join type.

Limitations of Relationships
- Relationships do not allow us to decide on the join type.

Joins

When we create a join we do so in the 'physical layer' of Tableau's data model. Unlike a relationship, a join will combine two tables into one. It is represented by a Venn diagram.

A join represented by a Venn diagram. Tableau's physical layer.

Why use joins over relationships?
We might want to control the way that we combine the tables, or deliberately filter or duplicate certain fields.

Benefits of joins over relationships:
-We can select the way we went to join the data.
- All measures are kept, even the ones that don’t match. unlike with joins, in which some measures get filtered. Joins will sometimes duplicate data stored at differing levels of detail.
-They do not require us to select a join type.

With joins we can select the way we want to join the data.

Limitations of joins:
-  Joins may sometimes produce missing or unmatched data fields.
-  Joins cannot be used on published data sources.
- The fields being joined must be of the same data type. If the data type is changed after the join, the join will break.
- If we want want to delete a field involved in the join (ie. a duplicated field), we can’t do so without breaking the join.


The above information is more or less a summary of the following pages on Tableau.com:
1. How Relationships Differ from Joins
2. Questions about Relationships, the Data Model, and Data Sources

Author:
Penny Richmond
Powered by The Information Lab
1st Floor, 25 Watling Street, London, EC4M 9BR
Subscribe
to our Newsletter
Get the lastest news about The Data School and application tips
Subscribe now
© 2024 The Information Lab