Table Relationship

A table relationship declares that two tables are connected by shared fields without merging them into one flat table. Tableau describes relationships as “a dynamic, flexible way to combine data from multiple tables for analysis”, and the defining property is what you do not specify: “You don’t define join types for relationships.”

In Tableau’s physical layer, a join combines its tables into one flat table that defines a logical table. That is fine when every table contributes only descriptive columns. It goes wrong when the tables carry measures of their own, because joining replicates them: “the measures in the dimension tables would be replicated, resulting in distorted aggregates unless you took precautions to deduplicate the values using LOD calculations or COUNT DISTINCT.”

That is the failure worth recognizing, because nothing announces it. The view renders, the chart fills in, and the totals are simply too large — each value counted once per duplicated row. A relationship avoids it by ordering the operations differently: “Tableau will aggregate measures before performing joins, avoiding the problem of unnecessary duplication.”

Leaving the join type unresolved until a view is built is also what makes a relationship reusable. Because “Tableau automatically selects join types based on the fields being used in the visualization”, one relationship serves views at different levels of detail, where a join commits every view to a single grain chosen in advance.

Tableau’s guidance is explicit — “We recommend using relationships as your first approach to combining your data” and “Use joins only when you absolutely need to” — with joins reserved for cases that “require a single table of data, such as extract filters and aggregation”. When you do join, the keys must match exactly: “the fields that you join on must be the same data type. If you change the data type after you join the tables, the join will break.”

References:


Discover more from Insightful Data Lab

Subscribe to get the latest posts sent to your email.

Similar Posts

Questions, corrections, or additional insights?

This site uses Akismet to reduce spam. Learn how your comment data is processed.