Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

Tableau LOD expression


May 26, 2021 Tableau


Table of contents


Details expressions are also known as LOD expressions in Tableau. /b10> Instead of bringing all the data to the Tableau interface, they are used to run complex queries that involve many dimensions at the data source level. /b11> A simple example is adding dimensions to calculated aggregate values.

THE type of LOD

There are three main types of LOD expressions.

  • FIXED LOD This expression uses the specified dimension to evaluate values without referencing any other dimensions in the view.
  • Detail expressions at this level of INCLUDE LOD use the specified dimension and any dimension in the view to calculate the value.
  • Detail expressions at these levels of EXCLUDE LOD subtract dimensions from the view level of detail.

FIXED level of detail expression

Let's find sales for each state in each region. /b10> Here we first use the following formula to create a formula field called Reggional Sales.

Tableau LOD expression

Next, we drag the Reggion and State files into theRows framework and the calculated fields into the Text text box below the Marks card. /b10> We also drag the Area field to the Color pane. /b11> This results in the following view, which shows fixed values for different states. /b12> This is because we have fixed the dimension to the area calculated by the Sales value.

Tableau LOD expression

INCLUDE level of detail expression

The INCLUDE detail expression level uses the specified dimension to calculate values in addition to any dimension in the view. /b10> Let's calculate the sum of sales for each state for each subcategory of products.

To do this, we drag the subcategory fields to the shelf. /b10> Let's write the following expression in the Columns shelf. /b11> It generates the following view, which includes two dimensions in the calculation.

Tableau LOD expression

EXCLUDE level of detail expression

THE EXCLUDE detail expression level specifies the dimensions to exclude from the details at the view level. /b10> Let's exclude the region from the sales calculated each month. /b11> The formula we created is shown below.

Tableau LOD expression

When we drag the relevant fields to the appropriate shelves, we get the final view of the EXCLUDE LOD.

Tableau LOD expression