Cardinality in Tableau Relationships

by Marcelo Ramos

Cardinality refers to how unique a field is in terms of its values. For example, if every record within a field is unique, then it has perfect cardinality, if there are duplicates present then the field has lower cardinality. In Tableau, it can be useful to know the cardinality of your fields of data before joining or creating relationships with your datasets.

With relationships, the Cardinality of your data would not usually matter too much if your data structure is small since Tableau processes data and queries very quickly, however when creating relationships between many datasets in large and complex workbooks on Tableau, these processes take a lot longer to run.

By correctly configuring the settings of cardinality in your relationships can boost the performance of your workbook as it optimizes the queries Tableau has to make. However, if you incorrectly configure these settings, you can run into problems where your data isn’t properly aggregated, because of either missing values or duplicated values which can easily ruin your analysis.

Tableau Cardinality Settings in Relationships

There are three types of settings you can have active for cardinality.

One-to-one: When both fields being related have no duplicates – Tableau doesn’t have to do any aggregation at the data source level (least process heavy).

One-to-one data

Many-to-one or One-to-many: One field has duplicates and the other has no duplicates – Tableau only has to aggregate data at the source level of one field.

Many-to-one data

Many-to-many: Both fields have duplicates (or you’re not too sure about the dataset) – Tableau will intuitively aggregate data at the source level  for both fields if need be (most process heavy).  This will always be the default when creating relationships and is the safest one to use.

Many-to-many data

At first, you probably want to stick to "many-to-many" relationships so that you don't run the risk of damaging the integrity of your data, but when the size of your data becomes larger, it would be a good idea to look into cardinality to make some changes to the relationships to optimize Tableau's processing.

Fri 30 Sep 2022

Thu 29 Sep 2022

Wed 28 Sep 2022

Tue 27 Sep 2022