7 Replies Latest reply on Jun 22, 2018 6:20 AM by Michael Gillespie

# Fixed vsInclude LOD

Hi Guys,

I am trying to understand a basic difference between fixed and include lod using a scenario.

It would be great if somebody can help me understand this.

I have 2 maps of USA with detail of States. In one of the map I used {fixed [Customer Name] : max(sales) } and in the other I have used {include [Customer Name] : max(sales) }.

I have used average measure of the above LODs in the label.

Outputs are different.

Can anyone please tell me how it gets manipulated in the back end by tableau?

.twbx file is attached.

• ###### 1. Re: Fixed vsInclude LOD

Hi Raj,

fixed LOD - wont consider the dimensions used in the  view it will calculate the avg at customer even though state field is available.

SQL Query : Select Customer ID, max(sales) from table group by Customer ID

Include LOD - It include customer name along with state so the avg will be calculated at state , customer level

SQL Query : Select state, Customer ID , max(Sales) from table group by State, Customer ID

Hope this explanation helps, kindly mark this question as helpful/correct if it resolves your question so that it will help others

1 of 1 people found this helpful
• ###### 2. Re: Fixed vsInclude LOD

Hi Rajarajan,

With the fixed calculation, you have fixed it against the customer ID, so for every customer ID, it will find the max value and average it. This is the MAX value for that customer overall, so it ignores whether it's the max value within the state.

E.g. With Carl Weiss:

His OVERALL max sum was 592.74.

However the include takes the state into account and therefore Carl Weiss' max sum of sales within the state of Montana is 29.04.

Does that make sense?

Fixed calculations do it without taking into account what's in the view. It does it purely based on the dimension(s) (if any) specified.

Whereas include takes the viz into account and brings dimensions into the calculations which aren't already in the view.

Thanks,

Mavis

1 of 1 people found this helpful
• ###### 3. Re: Fixed vsInclude LOD

Hello Rajarajan,

I can't open your sheet, hope you are using v 2018.

S

2 of 2 people found this helpful
• ###### 4. Re: Fixed vsInclude LOD

LoD Expressions are hard to understand.

In your example Fixed will calculate the maximum of sales per customer across ALL states. Then it will average across all maximum sales values of all customer that made a purchase in that state.

So if a customer made an order for \$1 in Texas and another for \$1000 in California for the Average of maximum sales in Texas it will use the \$1000 and not the \$1.

Include on the other hand will calculate the maximum of values per customer AND use the information from your view - so state.

For Texas it will use the \$1 order as maximum while for California it will use the \$1000.

1 of 1 people found this helpful
• ###### 5. Re: Fixed vsInclude LOD

Hi, Rajarajan

Please find my comments below to explain the difference between include and fixed.

Hope this helps

ZZ

• ###### 6. Re: Fixed vsInclude LOD

Thank you so much guys.

I have understood it now.

• ###### 7. Re: Fixed vsInclude LOD

This is the hardest concept to understand with LOD calculations, and Mavis, as usual, you have cut to the heart of it!

A core principle of Tableau is that everything that happens is in relation to what is in the view.  In other words, what measures and dimensions are showing in the current worksheet, and how are the calculations you are performing affected by what is showing in that worksheet?

So, to reiterate what Mavis said, with a slightly different emphasis:

A FIXED LOD calculation basically says "regardless of what you have showing in the worksheet/view, ALWAYS calculate this value using the following dimesion(s)".

An INCLUDE LOD calculation says "Use the following dimension(s) when you calculate this, EVEN IF they are not in the worksheet".

And an EXCLUDE LOD says "Even if this dimension is in the worksheet, DO NOT use it when you do the calculation".

That is a subtle difference but it's really important, as you found out when you ran the 2 different calculations yourself.  Others have explained the specific mechanics of how your calculations work, but this principle will help you figure it out later for the next one!

3 of 3 people found this helpful