Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

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
Honored Contributor III

Re: Comparing successive sales (i.e).

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

3 Replies

Re: Comparing successive sales (i.e).

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


talk is cheap, supply exceeds demand
antoniotiman
Honored Contributor III

Re: Comparing successive sales (i.e).

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

Re: Comparing successive sales (i.e).

Thanks Antonio, it worked!

Regards

Community Browser