2 Replies Latest reply on Feb 9, 2016 11:11 PM by Larsen Rennie

Diffrence of Sales between two or more periods

Hi All

I am facing one issue that we have a sales for diffrent years. I want to calculate the diffrence of sales of all the years  from the sales of  first year .For that i have used the table calculation but what table calculation it is removing sales for the first year(making it blank and rest all it is subtracting whereas i want to display the sales of the first year also. It should not disappear.

In that screen shot the value for 2011 is going 0 which i dont want . Instead i want that original sales of 2011 should display .

Is there any way we can achieve this

Any body can take the superstore data and can build the logic using that

Regards

Lokender

• 1. Re: Diffrence of Sales between two or more periods

Dear Rennie,

Please find the below calculation ,i think this is what you are looking for

if IFNULL((SUM([Sales])) - LOOKUP(ZN(SUM([Sales])), -1),0) = 0

then (SUM([Sales])) else zn(SUM([Sales])) - LOOKUP(ZN(SUM([Sales])), -1)

End

Please mark the answer as correct if it solves your problem.This will help other members when they are searching for solutions to similar problems.

• 2. Re: Diffrence of Sales between two or more periods

Hi Rajeev

Thanks for the help. This is exactly i was looking for

Regards

Larsen