Understanding {LOD} Level of Detail Expression

by Kristine Wiesner

One of the things I could not get around while learning Tableau is this concept of LOD or Level of Detail Expression.  By doing some practical challenges in Workout Wednesday, it has helped me to understand the concept better.  In this blog, I would like to share some tips and an example.

LODs are powerful calculations in Tableau that allows one to control the level of granularity or the level of detail of your expression.  They can be performed more granular level (INCLUDE), less granular level (EXCLUDE) or an entirely independent level (FIXED).

Granularity here refers to the representation of each distinguishable mark and number.  Similarly, level of detail refers to break down of information whether in a summary or high level detail or getting into more specific details.  The chart below shows a quick comparison of level of details.

HIGH LEVEL

LOW LEVEL

Leave out the details

Include the details

Only a summary

More details

Less granular

More granular

More aggregated

Less aggregated

Tableau's Order of Operations or the hierarchy of operation is an important part of LOD, because this is how the data are executed.  What this tell us, is that the very top, the Extract Filters, basically all operation respect this filter.  In terms of Fixed LOD,  they see and respect Context Filters, Data Source Filters and Extract Filters, but doesn't see the operation of Dimension Filter.

The Tableau order of operations includes the following, from top to bottom.

LOD Syntax are composed of  1. {} curly braces, 2. TYPE [Dimension], 3. A colon and 4. An Aggregate.

The [Dimension] could be optional, meaning could potentially have an LOD that has one, multiple dimension separated in a comma or may have none.

Using the Superstore data set, I would like to illustrate an example.  Say, I am interested to see the Sales on the State level in a map, and also showing the details of Country sales, Regional sales, State sales and the average sales for Customer in the state.  

One tip I can share while learning LOD is to build a text table first that has the numbers required to help compose the LOD expression.    This is helpful for two reasons:  One, is will serve as a reference, which will tell the dimension (blue pills) in the expression to generate the numbers needed.   And secondly, this text table will serve as a validation point, to check if the calculations are correct.

Here are the LODs I used to approach the problem.

And then I created a dashboard just to double check if the numbers are correct and if my LODs  matches the text table.