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.
![](https://www.thedataschool.co.uk/content/images/2023/11/image-285.png)
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:
![](https://www.thedataschool.co.uk/content/images/2023/11/image-287.png)
![](https://www.thedataschool.co.uk/content/images/2023/11/image-286.png)
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!
![](https://workout-wednesday.com/wp-content/uploads/2023/08/WOW2023-W31.png)