10 May What is LOD in Tableau?
An introduction to the concept of Level of Detail(LOD) expressions in Tableau.
Level of Detail (LOD) are expressions that give a user the privilege to control data computations on different levels of granularity in Tableau. We can perform simple or complex computations at a more granular level (INCLUDE LOD), or at a less granular level (EXCLUDE LOD), or at an independent level (FIXED LOD).
The LOD expressions in Tableau allows you perform aggregations that are unavailable at a certain level of visualization.
Types of LOD Expressions in Tableau
We have three types of LOD Expression in Tableau, they are;
- INCLUDE
- EXCLUDE
- FIXED
INCLUDE LOD
In Include LOD, the INCLUDE expression will include an additional dimension along with the one specified by the user. i.e. It brings including the view dimension into the calculation
The Syntax of the INCLUDE LOD is usually in the form below;
{[ INCLUDE ] < declaration > : <expression to aggregate>}
Step by step process on how to create INCLUDE LOD
Step 1
To Demonstrate this, we will use Superstore DATASET
Open Tableau Desktop and create a new worksheet
Step2
Drag Region to column and Sales to Rows
The next thing to do is to create LOD using the calculated field.
Step3
Create a new calculated field, then write this;
{INCLUDE [Customer Name] : SUM([Sales])}
The next thing is to drag the calculated field to the rows beside our sales. We should have 2 bar charts displayed.
Now, change the aggregation type of the sales per customer. We will do this by right clicking on the pill in our view and change it to Average.
We should have our visualization like this:
EXCLUDE LOD Expressions
The EXCLUDE level of detail or LOD in Tableau is used when we wish to leave out a dimension from the view level of detail. This is the opposite of what we saw in the INCLUDE LOD where a dimension from the view level of detail was being added with the user-specified dimension.
The syntax for EXCLUDE LOD Expressions is in the form below:
{[ EXCLUDE ] < declaration > : <expression to aggregate>}
Step by step process on how to create EXCLUDE LOD
Step1
Open a new worksheet
Step2
Drag the region and sales to the rows and Order Date to Columns.
We should have a line graph by default but we can change it to Bar chart using the Marks card. Our new visualization should look like this;
Step3
Create a new calculated field and put the code below;
{ EXCLUDE [Region] : SUM([Sales])}
Now, we will drag our newly calculated field to color on the marks card, for which we would generate this visualization.
FIXED LOD EXPRESSIONS
In the Fixed LOD type, the calculation only considers or computes the data values based on user-specified dimensions. It does not take into account the dimension present in the view.
The syntax for FIXED LOD Expressions is in the form below:
{[ FIXED ] < declaration > : <expression to aggregate>}
Step by step process on how to create FIXED LOD
Step1
Open a new worksheet
Step2
Drag Region and States to the columns.
Step3
Let’s create a calculated field for Sales by Region using the formula
{ FIXED [Region] : SUM([Sales])}
Let us drag the newly calculated field Sales by Region to Rows. We have this visualization;
Hope you found this post helpful. Thanks for reading.
No Comments