May 26, 2021 Tableau
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.
There are three main types of LOD expressions.
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.
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.
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.
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.
When we drag the relevant fields to the appropriate shelves, we get the final view of the EXCLUDE LOD.