In this blog, I would like to talk about LODThe reason for writing this is that some people may think of LOD as a challenge when they first start using LOD, as I did several weeks ago. They involve complicated concepts, such as when to use Fixed, Include and Exclude, and when to use Table Calculation. In this blog, I will walk you through the differences between LOD and Table Calculation, the order of operation that affects LOD, and steps to create LOD. I will also show you how to use LOD to finish a WOW challenge at the end of the blog.

When to use LOD or Table Calculation?

First of all, LOD is short for level of detailIt can provide you with more detail, beyond the current level of granularity in your view. Table calculation, on the other hand, is dependent on the current view. It is a good practice to apply LOD to the levels that are not on the view, then apply Table Calculations, Sets, or Parameters to the level on the view. The reason behind this practice is that LOD will also create a second table based on the metadata, whereas Table Calculation will not. 

Order of Operations will affect LOD performance.

Another important thing is to have the Tableau’s Order of Operations in mind when we talk about LOD.

Click here to find picture resource 

4 Steps to create LOD:

When creating a viz involving LOD calculation, I recommend you to follow the following steps to figure it out: 

  1. Analyse the questions you have, and which level of detail is appropriate. If you plan to change the dimensions of the dashboard with parameters, you should consider using Include or Exclude, otherwise just use Fixed. 
  2. Figure out the level of granularity in the view and not in the view. Ask yourself if your question includes a higher level or a lower level than what’s in the view. If the level is not in the view, we must apply LOD calculations. 
  3. Begin with a Crosstable to understand exactly what you want answers to. 
  4. Once you get the right answer to your questions, apply them to Viz. 

A Practical Example of Using LOD:

I am going to use the Workout-Wednesday Challenge 43-2018 to explain how to follow the above 4 steps. 

First, we should look at the questions in WOW43: 

Let us go through the main questions one by one:

  • Create a map and color the overall top, top 5, bottom, bottom 5 states by sales.
    • States should be in the view, so just combine two sets of the top 5 and bottom five.

  • Label the top 5 and bottom 5 states.
    • Use calculation based on the combined set of top and bottom states.

  • Show the city with the top sales for every state.
    • Cities are not in the view: use LOD/Fixed to fix sum( sales ) to the city level.
    • Top sale city in states: states are in the view, use window_max() to get the answer.
    • Create a calculation to filter only the top sale city in each state.

  • Place a star on the top 5 cities. Place an x on the bottom 5 cities. Place a circle in all other cities.
    • Top sale cities are in the view,  so just simply use sets and combine them to get top and bottom 5 cities.
  • The other important thing about this challenge is you have to put Segment to the Context filter to get your Fixed LOD work on every segment. Remember the Order of Operations we talked about a few minutes ago?
  • After we do a little bit more formating with the dashboard, finally it will be seen like this.

LOD is a useful calculation and can efficiently enhance your dashboard. Keep on practising and you can manage it.

Leona Lai
Author: Leona Lai