6 Replies Latest reply on Sep 21, 2015 6:12 AM by Daniel Vincent

# How to calculate delta Sale on max and min date

Hi everyone,

i have a Dashboard as the attachment. On the Slider "Year",  i have max date as 11/20/2015 and min date as 11/06/2015. i want to calculate the Date sale like this:

Delta sale = Sale on max date (11/20/2015)-Sale on min date (11/06/2015)

i have tried with some Calculation but it still doesnt work. Can you guy please help me. Thanks

• ###### 1. Re: How to calculate delta Sale on max and min date

Your workbook has no date field. So there is nothing to MIN() MAX().

• ###### 2. Re: How to calculate delta Sale on max and min date

This is quite odd.

I've been trying to help you and created two way of doing it, Using calculated fields with Window_Max and other using Index.

I always get to the same problem. The delta won't calculate and that should be the easy bit.

See attached, I'll carry on trying to find out what's causing it.

David

• ###### 3. Re: How to calculate delta Sale on max and min date

Sorry i attached wrong twbx, i have done it one again

• ###### 4. Re: How to calculate delta Sale on max and min date

Thanks David,

i have thought of Table Calculation also. But the Problem is that: i can not place Dimension "Year" in the Row shelf. What is Need are the Dimension "Class" and PR Number.

• ###### 5. Re: How to calculate delta Sale on max and min date

Do you know the date you want to work with?

Could you use a parameter for the delta dates?

Could you use year and hide the header?

David

• ###### 6. Re: How to calculate delta Sale on max and min date

If you're using Tableau 9 you can use a LoD calc:

SUM(IF [Year]={FIXED [Class], [PR Number]: MAX([Year]) } THEN [Sale] ELSE 0 END)

-SUM(IF [Year]={FIXED [Class], [PR Number]: MIN([Year]) } THEN [Sale] ELSE 0 END)

You can go from this:

To this: