Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Experts,
Can any one please help me on below requirement. I have the YTD sales in the months like below. From these YTD Sales need to calculate each month actual sales by Current Month -Previous Month sales. But when the previous month has no sales then current month has to show zero for example July has 500 but previous month Jun has no sales so July has to show zero as per expected output.
Please help me on this.
Month sum(sales) Expected output
Jan
Feb
Mar
Apr
May
Jun
July 500 0
Aug 700 200
Sep 800 100
Oct 900 100
Nov 1200 300
Dec 1400 200
Thanks in advance.
if(aggr(above(Sum(sales)),Month)=0,0, Sum(sales)-aggr(above(Sum(sales)),Month))
result:
I add the aggr by month so that if the sorting of the table is altered, the result does not change.
see:
Now, I change the sorting order of the Months: