Intro to LODs

Level of Detail Calculations or LODs for short allow you to calculate different values at the data source level and at the level of the visualisation. This gives you more control on what kind of level of granularity you want to compute.

At first let's begin by looking at what the LOD looks like. We will be using a fixed LOD.

A fixed LOD computes a value using specific dimensions, that you choose, without referencing those dimensions that you have placed in the view already. It looks like this:

{FIXED [Dimension(s)]: Aggregation}

To understand this better, it reads for every dimension, compute the aggregation. Everything in an LOD must be aggregated or you will get an error saying: 'Result of a level of detail expression must be an aggregate'.

If you want the aggregation to be fixed on nothing, then your LOD will look like this:

{FIXED: Aggregation} or just plainly {Aggregation} as not using 'FIXED' and just putting an aggregation in {} fixes it on nothing.

Now, let us create an LOD.

We will be using the Superstore dataset. When you have Tableau opened, drag Category and Sub-Category onto Rows and add Sales onto Text. Then, the next step would be to create the LOD - so create a calculated field that looks like this:

Category LOD

Then, add this calculated field in the view. You should get a table that looks like this:

As you can see here, the LOD calculated overall sales for each category. This is what the LOD does.

Now to add a few tips - you can create quick LODs in two ways.

  1. For example, if we want to create the LOD that states "For each Segment, Compute the Sales", we can ctrl drag Sales on top of the Segment and Tableau will create a calculated field titles Sales (Segment) and a Fixed LOD will be created. The LOD will end up looking like this:

2. Using the same example, we can ctrl select Sales and Segment and then Right-Click on Segment and click on Create and then select LOD Calculation. This will open up a calculated field that has the Fixed LOD written.

The calculated field will look the same as the point above.

So, there you have it, a brief introduction into LODs and what they do!

Hope this helps!

Author:
Gerda Staurylaite
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