Level of Detail Expressions (LOD) are very versatile and flexible. It enables users to get deeper insights into data. Understanding LOD can be a bit tricky. In this blog, we will be focusing on understanding the concept of Include LOD and its benefits.
What Include LOD does?
Include LOD enables calculations to be computed for dimensions present in the view (Rows, Columns and Marks) along with the dimensions not present in the view. Why would we require computations for dimensions that are not present in the view? The following example will help in understanding the necessity.
The dataset used for the following exercises is Sample-Superstore (2018).
Let’s try to find out Average Sales in every State.
Build the following chart showing Average Sales by each State.
The challenge is to find the average sales in each state per Customer. For achieving this if we add Customer Name dimension in our View, then existing view gets distorted as shown below:
We should be able to find the average sales in each state per customer without adding Customer Name dimension to the view.
This is where Include LOD helps.
The above expression tells Tableau to take into consideration Customer Name dimension along with State Dimension, which is already in the view, when calculating Average Sales even though Customer Name dimension is not present in the view.
Applying the above expression, we get the following output:
We can verify the results using another view. Build a view with Dimensions and Measures as follows:
Here both State and Customer Name dimensions are used. Therefore, the Average Sales is computed per customer for each State.
Go to Analysis->Totals->Add All Subtotals.
Analysis->Totals->Total All Using->Average.
This gives an output showing Average Sales per Customer for each state.
Comparing the Average Sales value for California in Image 4 and Image 5 we find the values are same.
Therefore, using INCLUDE LOD, Average Sales was computed for both State and Customer Name even though Customer Name was not present in the view.
LOD helps in solving many complex questions. We will be looking into other LOD expressions – Fixed and Exclude in subsequent blogs.
* * *
Learn more about Visual BI’s Tableau consulting & end user training programs here.