Blogs / Tableau / Understanding Level of Detail Expression (LOD) – Include

Understanding Level of Detail Expression (LOD) – Include

Mar 1, 2019

SHARE

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.

Understanding Level of Detail Expression (LOD) – Include
Image 1 – Chart showing average sales

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:

Understanding Level of Detail Expression (LOD) – Include
Image 2 – Including customer name distorts view

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.

Image 3 – Using LOD – Include

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:

Understanding Level of Detail Expression (LOD) – Include
Image 4 – Result after LOD – Include

We can verify the results using another view. Build a view with Dimensions and Measures as follows:

Understanding Level of Detail Expression (LOD) – Include
Image 5 – Average sales by State per customer for comparison

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.


Corporate HQ:
5920 Windhaven Pkwy, Plano, TX 75093

+1 888-227-2794

+1 972-232-2233

+1 888-227-7192

solutions@visualbi.com


Copyright © Visual BI Solutions Inc.

Subscribe To Our Newsletter

Subscribe To Our Newsletter

Join our mailing list to receive the latest news and updates from our team.

You have Successfully Subscribed!

Share This!

Share this with your friends and colleagues!