Level of Detail Expression in Tableau

Tableau has many options that users can apply in their calculations when they face a complex issue. It provides many features to make data analysis easy and fast for everyone. The features enable the professionals to create clearer and more informative visualizations. The LOD expressions make the customizations of charts and other graphs easy with the help of different types of LODs. Each LOD follows a specific syntax to provide a different result. The expressions work with data from all the industries or sectors. The article will enable you to understand LOD, different types of LODs, their syntax, and the commonly used LODs by data analysts and scientists.

What is LOD in Tableau?

We use LOD expressions to compute different values using different data sources and visualization levels. They make running complex queries easier by using different dimensions at the data source levels that deal with all the data uploaded into Tableau. It gives the users more flexibility by enabling them to conduct calculations at levels with different granularity and ensuring they apply calculations at both the row and view levels (non-aggregate and aggregate).

They are exact, and you can use them more discreetly. It gives you the power to perform all the data aggregations at a certain level of that visualization process.

Take your career to next level in Tableau with HKR. Join Tableau Online Training now.

Why use LOD in Tableau?

Many users ask themselves many questions which are hard to answer. LOD helps the users to get the answers using different syntax. The syntax is easy to use, making it easier to get answers to all your questions. It has enabled the users to get accurate results using different calculation methods. 

Tableau Certification Training

  • Master Your Craft
  • Lifetime LMS & Faculty Access
  • 24/7 online expert support
  • Real-world & Project Based Learning

Types of LOD expressions in Tableau

We have three types of LOD expressions. They include:

  • FIXED LOD: We use this expression to do calculations that handle only specific dimensions. It does not reference the remaining dimensions found in the view when the expression is implemented.
  • INCLUDE LOD: We use this expression to calculate all the details from all levels found in the database, and later we do a re-aggregation to a better level. Even if you add or remove any dimensions from the view, all the fields that have the expression will vary.
  • EXCLUDE LOD: We use this expression to eliminate all the dimensions with low granular levels and improve the concentration of calculating the dimensions, starting with the ones with high granular levels.

Syntax of LOD Expressions in Tableau

There is a syntax that one needs to follow when dealing with the LOD expressions. 

The syntax for INCLUDE LOD Expressions 

We use the following syntax of the INCLUDE LOD expression

{[ INCLUDE ] < dimension declaration > : }

The syntax for EXCLUDE LOD Expressions

We use the syntax below:

{[ EXCLUDE ] < dimension declaration > : }

The syntax for FIXED LOD Expressions 

{[ FIXED ] < dimension declaration > : }

Take your career to next level in Tableau with HKR. Join Tableau Online Training in Delhi now.

Limitations of LOD Expressions in Tableau

The following are some of the common limitations of LOD expressions in Tableau. These limitations include:

  • You can get unreliable results when the Lod expressions use floating values as the data types.
  • You can not locate LOD expressions under the data source.
  • When declaring a dimensional parameter, it is good to use the parameter name instead of its value.
  • During the data blending processes, one must link the primary data field with all the views before using the LOD expression mainly from the secondary data sources.

If you want to Explore more about Tableau? then read our updated article - Tableau Tutorial

Subscribe to our youtube channel to get new updates..!

Top 5 LOD expressions in Tableau

Tableau has over 10 LOD expressions. We will look at the five common LOD expressions.

1. Customer Order Frequency    

You use it when calculating the total orders made by customers. It breaks down the customers with the total orders made. You cannot handle this by using a measure with another measure. You have to know the total orders made by each customer. For example, you can use an expression like {FIXED [Customer]: COUNTD([Order Id])} under the rows and columns to calculate the several dimensions when you are creating a new field.

2. Cohort Analysis

It shows what contributes to sales. You can group customers according to particular behavior that leads to successful sales over a certain period. You can choose the minimum date when the sale occurred. In scenarios where data found in views is not displayable, you must use the  LOD Expression to fix the issues. It usually accepts data as the inputs and later divides them into small cohorts for better analysis. Some of the users share benefits or certain behaviors. For example, we use {FIXED : [nameofcustomer]: MIN([date of the order])} formulas to calculate customers' purchases where columns take the years while rows calculate the SUM aggregation.

3. Daily Profit KPI

We use this expression to measure the level of success daily. It helps in knowing the days the business made a profit, either per month or year. It will enable you to understand if any effects can affect sales during an ascertain season. When you have aggregated data and want to use it to find all the profits recorded daily. We have to look at the data on a transactional basis. If you measure the daily profits, we call it Daily Profit KPI analysis.  

4. Percent of Total

It helps in filtering data using fewer calculations. It deals with the market and, at the same time, provides measures globally. Many users use this expression to compute how a specific country's percentage relates to worldwide sales. For example, if you are calculating the sales worldwide. You will color the countries according to the percentage and show how each country contributes to the total distribution. 

5. New Customer Acquisition

We use this expression to find trends during customer acquisition. It enables you to understand how the marketing campaigns are doing and how to improve the sales organizations around different regions. For example, when you have a steep line, it also helps you understand the customer acquisition; when there is a flat line, it shows everything is not ok, and you will have to look at different factors. Using the expression ensures that you don't treat repeating customers as new customers as you need accurate data per each level.             

Click here to get latest Tableau Interview Questions and Answers for 2022

Tableau Certification Training

Weekday / Weekend Batches


Using LOD in Tableau is very important. All you need is to understand the syntax and where you can apply them. Using Tableaus to solve complex issues will be easy and fast when you know how to use them. Many users struggle with using LODs during the data analysis processes.

Related Blogs:

Find our upcoming Tableau Certification Training Online Classes

  • Batch starts on 2nd Oct 2023, Weekday batch

  • Batch starts on 6th Oct 2023, Fast Track batch

  • Batch starts on 10th Oct 2023, Weekday batch

Global Promotional Image


Request for more information

Research Analyst
As a senior Technical Content Writer for HKR Trainings, Gayathri has a good comprehension of the present technical innovations, which incorporates perspectives like Business Intelligence and Analytics. She conveys advanced technical ideas precisely and vividly, as conceivable to the target group, guaranteeing that the content is available to clients. She writes qualitative content in the field of Data Warehousing & ETL, Big Data Analytics, and ERP Tools. Connect me on LinkedIn.

It helps the user determine the marks found in a specific view. They use complex expressions to handle complicated queries.

It enables the user's segment the measures used in the project. The measures can be in different places like rows or columns.

Parameters are variables in the workbook like fields, dates, and numbers that make the users replace it easily using a filter, calculation, e.t.c.

You edit detail by heading over to the title, then navigate to the Edit title option, and you are good to go. It also depends on the type of operating system you use. For mac users, you right-click on the detail you want to edit and then choose the Edit option.

Tableau supports seven data types. These are strings, numeric values, dates, dates and times, boolean, mixed values, and geographical values.