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

Cumulative till month 12 of a year, and the reset the cumulative since month 01 of the following year

Let me give you another example, which is what I'm trying to get:

Data:
LOAD * Inline [
Date,Value
201810,22
201811,22
201812,10
201901,14
201902,18
201903,18
201904,21
];

Final:
NoConcatenate
Load
Date,
Value,
if(Date >= '201901',RangeSum(Value,Peek(Valuee))) as Valuee
Resident Data
Order by Date;

Drop Table Data;

susopark_0-1651663812463.png

 

 

These are the result sets. The cumulation starts from 201901, therefore the condition I made in the final tabla. Nonetheless I also need the cumulation from 201810 til 201812. 

How do I do this?

Labels (4)
1 Solution

Accepted Solutions
eddie_wagt
Partner - Creator III
Partner - Creator III

I think you will need this.

 

Data:
LOAD * Inline [
Date,Value
201810,22
201811,22
201812,10
201901,14
201902,18
201903,18
201904,21
];

Final:
LOAD Date
,	 Value
, 	 if(Previous(Year)=Year,RangeSum(Value,Peek(Valuee)),Value) as Valuee
;
NoConcatenate
LOAD
left(Date,4) as Year,
Date,
Value
Resident Data
Order by Date;

Drop Table Data;

View solution in original post

3 Replies
eddie_wagt
Partner - Creator III
Partner - Creator III

I think you will need this.

 

Data:
LOAD * Inline [
Date,Value
201810,22
201811,22
201812,10
201901,14
201902,18
201903,18
201904,21
];

Final:
LOAD Date
,	 Value
, 	 if(Previous(Year)=Year,RangeSum(Value,Peek(Valuee)),Value) as Valuee
;
NoConcatenate
LOAD
left(Date,4) as Year,
Date,
Value
Resident Data
Order by Date;

Drop Table Data;
susopark
Contributor II
Contributor II
Author

Thank you so much!

eddie_wagt
Partner - Creator III
Partner - Creator III

You're welcome!

Regards Eddie