Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Result from month based on previous months

Hi,

We are struggling with set analysis trying to calculate a result for a specific month based on values from previous months. For sake of simplicity we boiled this down to its essentials.

Consider the following table:

 

ReportingMonthMonthYearThis MonthPrev Month
0Oktober 20164478680
1September 2016424493,990
2Augustus 20163925330
3Juli 20162868350
4Juni 20163968990
5Mei 20163550930
6April 20163274920
7Maart 20163268110
8Februari 20164457980
9Januari 20164005350
10December 20152380790
11November 2015268218,670
12Oktober 2015330089,610

In the 'Prev Month' column (where currently only zero's are displayed) we want the value from the next row to appear. We tried doing so using set analysis as follows:

Sum({$<ReportingMonth={"$(=Test2)+1"}>}InvoiceQuantity)

Test2 is a LET variable: LET Test2 = 'ReportingMonth + 1';

The above table should look as follows:

 

ReportingMonthMonthYearThis MonthPrev Month
0Oktober 2016447868424493,99
1September 2016424493,99392533
2Augustus 2016392533286835
3Juli 2016286835396899
4Juni 2016396899355093
5Mei 2016355093327492
6April 2016327492326811
7Maart 2016326811445798
8Februari 2016445798400535
9Januari 2016400535238079
10December 2015238079268218,67
11November 2015268218,67330089,61
12Oktober 2015330089,61398637

We have gone through a whole bunch of variations as well as through a miriad of posts on the community. No luck and pretty frustrating. So any help will be highly appreciated.

Thanks!

10 Replies
rubenmarin

Hi Jeroen, maybe this blog post helps you to make easier accumulations:The As-Of Table