Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
As an example I have a sales table and a typical master calendar table with SalesDate, Month, MonthYear, etc.
Sales:
SalesDate | Sale |
2016-12-20 | 300 |
2017-01-01 | 300 |
2017-02-20 | 450 |
2017-03-22 | 490 |
2017-03-23 | 90 |
I need to make a table/graph with each successive variation from month to previous month, each month shows the increase % in sales from previous month, like this:
MonthYear | Variation previous month |
Jan-2017 | 0% |
Feb-2017 | +50% |
Mar-2017 | +28% |
My doubt is how to get the sales from the previous row on dimension MonthYear, for all the dimension values.
Thanks Regards
Hi Paulo,
LOAD *,MonthName(SalesDate) as MonthName;
LOAD Date#(SalesDate,'YYYY-MM-DD') as SalesDate,
Sale
FROM
"https://community.qlik.com/message/1276468"
(html, codepage is 1252, embedded labels, table is @1);
Dimension : MonthName
Expression :
(Sum(Sale)-Above(Sum(Sale)))/Above(Sum(Sale))
Regards,
Antonio
You can do it with an AsOf table: The As-Of Table.
Hi Paulo,
LOAD *,MonthName(SalesDate) as MonthName;
LOAD Date#(SalesDate,'YYYY-MM-DD') as SalesDate,
Sale
FROM
"https://community.qlik.com/message/1276468"
(html, codepage is 1252, embedded labels, table is @1);
Dimension : MonthName
Expression :
(Sum(Sale)-Above(Sum(Sale)))/Above(Sum(Sale))
Regards,
Antonio
Thanks Antonio, it worked!
Regards