9 Replies Latest reply on Nov 6, 2017 7:46 PM by Deepak Rai

# LOD calculation

How can I change this Fixed LOD calculation { FIXED [State],[Order Date] : MAX([Sales])}

For Texas, California, and Florida only, and for the months of March, July and September only?

Similarly, how can I write a LOD calculation for Superstore "furniture" sales during Christmas time?

Thank you!

• ###### 1. Re: LOD calculation

Hi Lori,

my basic answer would be: add State and Order Date as filter (put them in context unless they won't be applied to your LOD), and select only the Texas, California, and Florida only, and for the months March, July and September only.

is this what you were looking for? or you want to "filter" in your calculation directly?

Dominique

• ###### 2. Re: LOD calculation

Hi Lori,

Any row-level filtering you need with LOD calculations should be done inside the innermost parenthesis if you want those values to be static.

{ FIXED [State],[Order Date] : MAX(IF ([State] = 'California' or [State] = 'Texas' or [State] = 'Florida') and (datename('month',[Date]) = 'March' or datename('month',[Date]) = 'July' or datename('month',[Date]) = 'September') then [Sales] end)}

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

Galen,

you miss parenthesis between your datename OR clauses (as you did for the State OR clauses)

Dominique.

• ###### 4. Re: LOD calculation

Hi Galen. Thank you. How can I correct this calculation?

{ FIXED [Category],[Sub-Category] : SUM(IF [Category] = 'Furniture') and ([Sub-Category] = 'Tables') then [Profit] end)}

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

{ FIXED [Category],[Sub-Category] : SUM(IF ([Category] = 'Furniture') and ([Sub-Category] = 'Tables') then [Profit] end)}

2 of 2 people found this helpful
• ###### 6. Re: LOD calculation

Thank you, Deepak!

• ###### 7. Re: LOD calculation

Sorry I missed this!

Yes - I realize I missed some parenthesis. Correcting now so someone in the future doesn't stumble upon this almost-answer

• ###### 8. Re: LOD calculation

You are Welcome!!!

• ###### 9. Re: LOD calculation

Not To Worry. I do it all the time