Part-2 LOD Expression
This is the continuation of the Part-1 LOD calculation series. If you haven’t read Part 1 read it first.
2. FIXED LOD:- Fixed Level of details expression computes values based on the specific dimension paying no attention to the view level of details. It is completely independent of the view level granularity.
See this example in Tabular form to see how Fixed expression works:-
In the above Table, IF we apply a Fixed expression, What it will do is that? It will aggregate the sales at the customer level and after that, without considering the View level which is Category it will average the values(5th column).
Take another situation where you want to find Regional Sales per Category?
Fixed Calculation:-
{FIXED [Region] : SUM([Sales])}
The expression takes the Sum of Sales to each REGION. Because we applied FIXED LOD & our view level is Category, it will completely ignore the View level (Category). This calculation is fixed to calculate the Sum of Sales for each Region and after the following values are computed without considering which purchase belongs to which category, it will give us the final value. The values are then aggregated into an average.
Looking at the above plot you can see that all the bars show the same value for each category.
This is the problem with a FIXED expression. It completely leaves the View level only considering what’s inside it.
It creates problems in comparing the different categories in the table.
3. EXCLUDE LOD:- The exclude expression considers the granularity of the Viz but performs operations at a less granular level.
Let’s see it directly in Tableau:- Consider yourself you are doing some calculation and there are a couple of Dimensional variables in the Viz and you want to calculate the total but considering only one variable, means you don’t want to consider all the variables. In that case, INCLUDE & FIXED will be not useful because both will do the view the level of calculation. When this type of situation arises you use EXCLUDE expression.
# Let’s say you want to find the Regional Sales but in your view, one more extra variable exists, in that case, we use EXCLUDE.
Expression:-
{EXCLUDE [Region]: SUM([Sales])}
from the above figure, you can see the 2nd column Exclude Sales region, it gives us the Sales per Region and that’s the result we want, not the result shown by basic calculation in the 1st column. EXCLUDE expression, completely ignore the category variables and gives the result at a less granular level which is Region, and that’s what we want.
Note:- I will talk about more FIXED LOD calc & EXCLUDE LOD calc in the upcoming series. How to leverage them, and where to use them.
If you like the content, please hit the like button.