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: 
Chinnu3
Contributor III
Contributor III

Cumulative data by Month selection

Hi All,

I want the data in a Cumulative way like 

My Data starts by Jan 2021, if I select the Jan 2021, I want to see that month data and If i select Feb 2021 then I want to see the cumulative data of Jan and Feb, If i select the March 2021 then I want to see the Jan, Feb, March 2021 data Cumulative.

Chinnu3_0-1669009525558.png

Result I want like this

Chinnu3_1-1669009604705.png

 

Thanks in Advance.

 

Labels (5)
1 Solution

Accepted Solutions
Saurabh_K14999
Contributor III
Contributor III

Hi,

By using rangesum and peek function you can achieve the required output.

Use the below script for your desired output

EMP:
LOAD * INLINE [
ID,Name,Order_Date,Sales
1,Satish,1/2/2021,100
2,Ravi,2/3/2021,120
3,Kiran,3/4/2021,130
4,Chandra,4/5/2021,140
5,Satish,5/6/2021,150
];

New:
Load
ID,
Sales,
Name,
"Order_Date",
Rangesum(Sales, Peek(CumulativeSales)) as CumulativeSales
Resident [EMP]
order by "Order_Date";
Drop table EMP;

exit Script;

Saurabh_K14999_0-1669016388268.png

Regards,

SK

View solution in original post

2 Replies
Saurabh_K14999
Contributor III
Contributor III

Hi,

By using rangesum and peek function you can achieve the required output.

Use the below script for your desired output

EMP:
LOAD * INLINE [
ID,Name,Order_Date,Sales
1,Satish,1/2/2021,100
2,Ravi,2/3/2021,120
3,Kiran,3/4/2021,130
4,Chandra,4/5/2021,140
5,Satish,5/6/2021,150
];

New:
Load
ID,
Sales,
Name,
"Order_Date",
Rangesum(Sales, Peek(CumulativeSales)) as CumulativeSales
Resident [EMP]
order by "Order_Date";
Drop table EMP;

exit Script;

Saurabh_K14999_0-1669016388268.png

Regards,

SK

Chinnu3
Contributor III
Contributor III
Author

Hi Saurabh,

Thanks for the solution.

If I want to make this in Frontend only, then is it possible through Set analysis?

If it is possible please let me know how can we do that.

Thanks in Advance.