How to create a quick LOD in Tableau

LOD (Level of Detail) expressions are used to compute values on different levels of granularity. Among the expression, FIXED expression is very powerful as it allow users to control the calculation an entirely independent level. From the version 2021.1, Tableau has built in a quick LOD function, which empower users to create a LOD based on a Measure and a Dimension.  Today’s blog is a guide to create a quick LOD in two ways.

Now let’s look at our classic Superstore dataset. Let’s say I want to create a LOD of Sale by Sub-Category.

The first way is to press Ctrl and drag the Sales measurement to the Sub-Category dimension. Tableau will automatically create a new field called Sales (Sub-Category).

This could be done by a second way when you choose both dimension and measurement (Ctrl when click on the second one). Then when you right click, there is an option to create LOD Calculation which results to an exactly same field as we had before.

Now to see what Tableau did in the calculation, you can right click on the new field and choose Edit.

Sales (Sub-Category) is the sum of Sales for each Sub-Category.

Can we change this calculation? Yes, we can. If I want to calculate Sub-Category average Sales by Category, I can drag my new quick LOD (Sub-Category) into Category field. Now our new created LOD names Sales (Sub-Category) (Category). If you wish to edit it calculation, just replace SUM by AVG.

I actually knew about the quick LODs after I did a Workout Wednesday challenge https://www.workout-wednesday.com/2021/04/20/2021w16tab/. If you want to apply quick LODs calculation, give it a try!

Good luck and have fun!

Author:
Nhung Le
Powered by The Information Lab
1st Floor, 25 Watling Street, London, EC4M 9BR
Subscribe
to our Newsletter
Get the lastest news about The Data School and application tips
Subscribe now
© 2024 The Information Lab