Nested LODs: When and How?

In simple terms a Nested LOD is an LOD inside another LOD. Double the LOD power.

Let's see how they work.

Here we have a simple table showing the Sales made within different Categories and Sub Categories.

A realistic situation is that we may want to compare the sales of individual Sub Categories to other Sub Categories within their Category, maybe the best or worst performing ones. In simpler terms, a business owner may want to compare the sales of their Bookcases to the best performing Sub Category within the Furniture category. In order to do this, a Nested LOD is required. Here is the end result and then our calculation:

What is this calculation saying in plain English?

Let's read the second line, or the Inner LOD first:

For each individual Sub Category, we want to bring back the Sum of Sales.

Our first line reads:

for each Category, bring back the MAX of our INNER LOD.

So our Inner LOD will Sum Sales for every Sub Category, and our Outer LOD will bring back the Sales of the Sub Category that has the highest sales within its Category.

It can be quite difficult to wrap the head around, that's for sure. But Nested LODs can be extremely powerful.

For more practice with Nested LOD's give this Workout Wednesday a go!

#WOW2023 W31: Can you find the most popular sub-category by sales per state? – Workout Wednesday

Author:
Patrick Maguire
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
© 2025 The Information Lab