Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have following table and want to have a ratio between current month and last month, how about the expression ?
Year | Month | Sales |
---|---|---|
2014 | 1 | 100 |
2014 | 2 | 220 |
2014 | 3 | 300 |
2014 | 4 | 120 |
2014 | 5 | 400 |
Is my below expression correct ?
Sum(sales)-sum({<Month=(Month-1)>} sales)
Expecting view is like below.
Thanks&Regards,
Jessica
I think to get accurate results during the year change, you need to do this in the script.
Table1:
load Year,Month,Sales,Year&Num(Month,'00') as YearMonth inline
[
Year,Month,Sales
2014,1,100
2014,2,220
2014,3,300
2014,4,120
2014,5,400
];
NoConcatenate
LOAD Year,Month,Sales,YearMonth,
if(Date#(Peek('YearMonth'),'YYYYMM')=Date(addmonths(Date#(YearMonth,'YYYYMM'),-1),'YYYYMM'),Peek('Sales'),0) as PreviousSales
resident Table1
order by YearMonth;
drop table Table1;
In the chart object
use the expression sum(Sales)-sum(PreviousSales)
HTH
Sas
hi
did you manage to solve the issue?
Sasi