The main goal of Tableau is to provide data analysis, with a flow. If anyone has any difficulty with how to use the tool while solving the problem, then the flow state is broken.

One ordinary cause of this issue is, it’s necessary to work with data that has been collected to various levels of Details in Tableau. Questions might arise while analyzing data, like Can we plot a number of days, per quarter when my company had more than 100 orders? For more info on Tableau Training
To answer these kinds of questions, In Tableau 9.0, a new syntax has been introduced, called LOD functions in Tableau. This new syntax clarifies and expands Tableau’s estimation language by addressing, the level of detail questions directly.
How to create LOD expressions Tableau?
LOD expressions tableau makes us calculate values, at the data source level and the picturization level. LOD expressions tableau provides more control, on the level of granularity on which you want to calculate.
They can be operated at different levels of granularity.
Follow the below steps to create and use LOD functions in Tableau.
1. Organize the Visualization
- Open the Tableau Desktop and connect to the Sample data source saved Superstore.
- Go to a new worksheet
- From the Data pane, in the dimensions, move Region to the Columns shelf.
- From the Data pane, in the Measures, move Sales to the Rows shelf. Then, a bar chart displaying the sum of sales for every region is visible.
2. Design the LOD expressions Tableau Online Training
Other than the sum of all sales per location, if you want to view the average sales per consumer for every location. Then we can use LOD expressions Tableau, to perform this.
- Go to Analysis and choose to create a calculated field.
- A calculation edit page will open, In that give the name of the calculation and Sales per consumer. And type the below LOD expression.
{ INCLUDE [Customer Name] : SUM([Sales])}
- After completion, select OK.
Under Measures, in the Data pane, new LOD expression is added.
3. Use the LOD expression tableau in the visualization
- Under Measures from the Data pane, move Sales Per Consumer to the Row shelf and set it to the left of SUM(Sales).
- In the Rows shelf, click the right button of the mouse on the Sales per consumer and choose Measure(sum) > Average.
Now, we can see the average sales per consumer and also the addition of all sales for the individual location.
Types of LOD function in Tableau:
We can create three types of LOD Expressions. They are
1. Exclude
2. Include
3. Fixed
1. Exclude:
Exclude LOD expressions tableau mentions, the dimensions that to be neglected from the view level of detail. Learn more skills from Tableau Certification
These expressions are useful, for the difference from the total average or ‘percent of total’ situations. They are similar to properties, as Reference lines and totals.
In row-level expressions, in which there are no dimensions to neglect, Exclude LOD expressions are used. These can be used to change, the view level estimations or remove dimensions form some other LOD Expression tableau.
2. Include:
Include LOD expressions tableau, to calculate values with particular dimensions additional to the dimensions that are in view.
If you want to estimate at a fine level of detail in the database, and then re-collect and display at a rough level of detail in your view, then use Include LOD expressions.
Fields depending on the Include LOD expressions will be changing, as you attach or delete dimensions from the view.
3. Fixed:
Fixed LOD expressions tableau calculate a value with particular dimensions, without any reference, to the dimensions in the view.
Syntax for LOD Expressions tableau:
{[FIXED | INCLUDE | EXCLUDE] <dimension declaration> : < aggregate expression>}
{ } – complete LOD expression is enclosed in curly brackets.
[FIXED | INCLUDE | EXCLUDE] – here we have to mention the type of level of detail.
<dimension declaration> – mentions one or more measurements, that are combined with the aggregate expression.
: – colon symbol differentiates both dimension declaration, and aggregate expression.
<aggregate expression> – This is the calculation done to specify, the target measurements.
In this article, I have explained about how to create LOD functions in Tableau and Types of Level of Detail Tableau expressions. In my next article, I will explain about Limitations of LOD.
To get in-depth knowledge, enroll for a live free demo on Tableau Online Course