Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Comparing successive sales (i.e).

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

1 Solution

Accepted Solutions
antoniotiman
Master III
Master III

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

View solution in original post

3 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

You can do it with an AsOf table: The As-Of Table‌.


talk is cheap, supply exceeds demand
antoniotiman
Master III
Master III

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

Not applicable
Author

Thanks Antonio, it worked!

Regards