Let’s Work Together

Image Alt


Tableau – How to implement EXCLUDE LOD and its benefits


We’re going to be using the exclude level of detail calculations and this will start by giving a brief introduction about what an Exclude LOD is? Just for a brief introduction about Tableau exclude functionality, it is used for removing some level of the details from the visualization in terms of using that field in the calculation.

Implementation – Tableau Exclude Level of details

What we’re using today is the superstore sales data that is available from Tableau’s website. So fixed level of detail calculations, just to review, calculate the sum of a measure at a fixed level of detail in this case we’re using the product category. Now if we create this same table – so we’ll drag out the product category onto our rows shelf product-subcategory onto the rows shelf and then we’ll drag out sales onto our ABCs here to create the same table. Then what we have is an opportunity to do the same thing but in a slightly different way.

Reviewing Fixed LOD

So a fixed level of detail calculation always calculates at the product category level. An exclude level of detail calculation will exclude something that is in our visualization from the calculation. So in this case, if we excluded the product sub-category, then we would be calculated at the product category level. So we’ll go ahead and do that. We’re going to create an exclude subcategory.

A Normal Sum of Sales by Category
Creating a Calculated field :

Alright, then we will open up our level of detail calculation here. Let us name it the sum of sales. So we’re going to say exclude product sub-category, and now we’re going to exclude the product sub-category from our visualization.

Normal aggregation numbers before Exclude LOD calculation

So now you can see that the numbers are the same (above screenshot) because we weren’t excluding anything but if we hit apply you’ll see that now we’re calculating at the product category level (below screenshot) because we’re excluding this product sub-category.

Aggregation numbers after Exclude LOD calculation

So this again as sales we could divide these two and we could get the percent of sales by product subcategory.

What happens now though that’s a little bit different than what happened before is that if we take province and we drag province out in between the two, you’ll see that we’re now getting the sum. The sum of all of the furniture sold in Alberta excluding the product subcategory. So this is actually changed.

If you remember when we did this with a fixed level of detail calculations we were still getting the sum for the entire furniture category. Now we’re just getting it for furniture sold in Alberta.

So we’re still excluding this particular product sub-category, but we’re not always calculating at a fixed level. Again, this is helpful. it’s going to allow us to, if we wanted to, we could divide sales by this product sub-category and we could get the percent of sales for that particular product category and province, or if we wanted to add anything else to the view it would continue to only exclude that sub-category.

This is it from my end on Tableau – How to implement EXCLUDE LOD and its benefits. If you have questions please leave them in the comments. Also, check out my more blogs on the Tableau series.

I am a Data Engineer and Analyst working for 5 years in different domains starting from Healthcare, Recruitment, HR, and now Operations. During my voyage, I have worked in Pyspark, SQL, Tableau, Python, ETL, and AWS cloud services.

Add Comment