Starting with Tableau? Understand the Data Model

Photo by Markus Winkler / Unsplash

The Tableau data model is a structure that organizes and manages the data used in Tableau. In a very simple sentence: Is how you connect and combine data from the same/ various sources. You start creating the data model by dragging a dataset/sheet to the canvas.

NOW!!
The data model is composed of two layers:
 The logical layer
 The physical layer
Understanding the difference between these layers is crucial to ensure accurate data analysis and visualizations.


Logical Layer:
The logical layer is performed at the very superficial canvas level. By default, just dragging a dataset  to the canvas, you create the logical layer. By dragging another dataset to the canvas (not on top of the previous dataset), you create a logical layer with relationships (orange noodles). MEANING: You bring together multiple datasets and relate them/connect them based on a minimum of one common field.

When to use: The logical layer is used when you have multiple tables that you want to analyze together, but they have different levels of granularity (different levels of detail).

E.G. You have a sales table that contains daily sales data for different products, and a separate promotions table that includes information about promotional campaigns and their durations. Using the logical layer, you can establish a relationship between the sales and promotions tables.  This allows you to analyze sales data alongside the relevant promotional periods accurately, without duplicating data and maintaining the original granularity of each table.


Physical Layer: To 'access' the physical layer, you just double click the dataset that you want to combine other data with (the logical layer acts as a container for the physical one). The physical layer is on a Join/Union basis in the canvas and defines how the data is combined between them. The data is merged into a single table (also based on a common field) and will  modify the structure of the logical layer (2 or more tables will be put together into a single table) + improve data retrieval and analysis.

When to use: The physical layer is used when you need to combine tables with similar granularities. If you have two tables with the same level of detail, where each row represents a single entity, joining them together makes sense. It will create a single table with all the relevant information.
(CAREFULL: If data with very different levels of granularity are put into the physical layer, it can duplicate values IF DATA WITH VERY DIFFERENT LEVELS OF GRANULARITY ARE PUT INTO THE PHYSICAL LAYER,  WILL LIKELY DUPLICATE VALUES AND THEREFORE --> NON ACCURATE ANALYSIS/VISUALIZATION OF THE DATA)

E.G. Imagine you have two different tables: one with sales data and another with customer information. In the physical layer, you specify how these tables are joined or connected based on their common fields, such as a customer ID. This connection helps Tableau understand how the data should be combined when you create visualizations or perform calculations.

Hope this helps you better understand how to bring data together in Tableau for accurate analysis and visualization.

Author:
Francisco Rei
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