LODs in a shellnut

Level of Detail calculations when you first start your Tableau journey can be extremely daunting - those mustachios ({}) represented the bane of my existence when I first started mine and learning how to understand those has been something that I'm happy to say I've achieved throughout my time in the DS.

You can get a LOD going by opening a calculated field and either typing 'FIXED', 'INCLUDE' or 'EXCLUDE', as well as just starting off with a '{'. Include and Exclude aren't used as often as Fixed is, and because of that, we'll be looking more closely to Fixed, rather than the other two.

Using Fixed in your LOD locks your calculation's analysis level, either at a 'for every dimension' level, or for the level of a specified dimension. For example, in one of Tableau's favourite blogs (https://www.tableau.com/about/blog/LOD-expressions), the LOD of {FIXED [Customer ID] : MIN([Order Date])} gets brought up consistently. What this LOD is asking for is that 'for every CUSTOMER ID, give me their very first (minimum) ORDER DATE'. I've found its always helpful to break down these calculations in this way, saying it all out loud never seems to be a problem, bar the weird looks you might get in the office. If you don't specify a dimension in your calculation, you'll get your specified measure at every single level, compared to just at that specified level of the dimension used.

We're seeing here the dates of every single purchase made by these customers in the first column, with the second column showing ONLY the date of their first order

This is a super handy calculation that opens pathways for things like a cohort analysis, seeing how the sales from first-time customers in different years compare over time, and seeing which of these customers make up a bulk of the profit for a company. Not to mention as well, it's a handy calculation to know when approaching the Tableau Certified Data Analyst exam.

Author:
Zachary Ryan
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