# Exclude Level of Detail Calculation: Tableau Functions

> This is content from just-tim, the data-and-analytics channel by Tim Ngwena (formerly 'Tableau Tim'). Tim has 12+ years of hands-on BI experience and covers Tableau most of all, plus Power BI, Looker, Hex, SQL and data modelling, the analytics industry, and the craft of doing the job — always tool-agnostic and honest about the trade-offs.

- **Author:** Tim Ngwena (just-tim, https://just-tim.com/about)
- **Published:** 2021-03-25
- **Format:** Video · 1496 min watch · transcript available
- **Topics:** Data visualisation, Analytics
- **Tools:** Tableau (calculated fields, lod expressions, parameters)
- **Canonical:** https://just-tim.com/posts/exclude-level-of-detail-calculation-tableau-functions
- **Watch:** https://youtu.be/BfXA-3bKG_k

This is the final video in my Level of Detail series, covering the exclude LOD function in Tableau. I explain how it works with the viz level of detail by removing a dimension before aggregating, then build a practical category comparison example using a parameter, inspired by Bethany Lyons' top 15 LOD blog post.

## Key takeaways

- The exclude function works against the viz level of detail, effectively removing a specified dimension from the view before performing the aggregation
- Unlike fixed LODs, both include and exclude functions are influenced by what you place in the visualisation, so adding dimensions like region can unexpectedly change your results
- Exclude often returns ATTR() because apportioning a higher-level value across a finer-grained view is the only way it can display the result
- When building complex calculations, set everything up as a table first to verify your numbers before creating charts and worrying about formatting
- You can combine a string parameter with an IF calculation and exclude LOD to build a dynamic comparison chart that recalculates against any selected subcategory

## Chapters

- 0:00 Recapping the LOD series
- 1:29 Viz level of detail refresher
- 2:56 Writing the exclude calculation
- 4:50 Seeing exclude in action
- 7:35 The attribute behaviour explained
- 9:08 How view changes affect the result
- 10:28 Building the comparison chart example
- 13:28 Creating the parameter and calculations
- 18:28 Finishing the visualisation
- 23:44 LOD resources and wrap-up

Watch the full video, read the transcript and use chapter deep-links on the page: https://just-tim.com/posts/exclude-level-of-detail-calculation-tableau-functions

---
just-tim — Data and analytics, with a point of view. · https://www.youtube.com/channel/UC7HYxRWmaNlJux-X7rNLZyw · https://twitter.com/TableauTim · https://www.linkedin.com/in/timngwena
