Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, please help me. I have this table and I need to compare amount of sales between months in percentage and then I need to make a chart from it. How can I do that?
PERIOD | SALES |
---|---|
201601 | 256 |
201602 | 263 |
201603 | 486 |
201604 | 156 |
201605 | 848 |
201606 | 564 |
201607 | 452 |
201608 | 489 |
201609 | 856 |
201610 | 485 |
201611 | 523 |
201612 | 875 |
May be like this:
Sum(SALES)/Above(Sum(SALES)) - 1
Update: Missed a closing parenthesis which I have added not in red
sum(SALES) / sum( Total SALES)
I´m sorry, I have not expressed myself clearly. I need to show the percentage growth between months. Can you help me?
May be like this:
Sum(SALES)/Above(Sum(SALES)) - 1
Update: Missed a closing parenthesis which I have added not in red
Sum(SALES)/Above(Sum(SALES)
Hi,
You can create a calendar like :
LOAD Date#(PERIOD, 'YYYYMM') as _PERIOD, SALES INLINE [
PERIOD, SALES
201601, 256
201602, 263
201603, 486
201604, 156
201605, 848
201606, 564
201607, 452
201608, 489
201609, 856
201610, 485
201611, 523
201612, 875
];
SET vMinDate = 201601;
SET vMaxDate = 201612;
CAL:
LOAD
Date#($(vMinDate)+RecNo()-1, 'YYYYMM') as _PERIOD,
Date#($(vMinDate)+RecNo()-1, 'YYYYMM') as PERIOD,
'M' as TYPE
AutoGenerate ($(vMaxDate)-$(vMinDate)+1)
;
Concatenate(CAL)
LOAD
Date(AddMonths(Date#(_PERIOD, 'YYYYMM'), -1), 'YYYYMM') as _PERIOD,
PERIOD,
'M1' as TYPE
Resident CAL
;
And this expression :
Sum({<TYPE={'M'}>}SALES)
/ Sum({<TYPE={'M1'}>} SALES)
Thank you very much, it works!