Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
vikasshana
Creator II
Creator II

How to get sum of above value in Qlik Sense

How to het sum of above value in Qlik Sense
 


Hi,

I have the below straight table in my app

ID Sales
1 100
2 200
3 300
4 400
5 500


Looking for set analysis expression and would like to see the below result in straight table.

ID Sales New Column
1 100 100
2 200 300
3 300 600
4 400 1000
5 500 1500


As you can see the 'New Column' field is taking the sum of their respective above rows. Looking for set analysis expression to achieve it.

Regards,

Vikas

Labels (4)
4 Replies
MayilVahanan

Hi 

Try like below

Rangesum(Above(Sum(Sales), 0, RowNo(Total)))

MayilVahanan_0-1649838633001.png

 

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
SunilChauhan
Champion
Champion

I have tried Mayil Solution thats work perfect but when we have more date in Table it become slow

we can try in script a recursive Function

Load ID, Sales

rangesum(peek('cumulativeSum'),Sales) as cumulativeSum

From Table order by ID;

 

hope this helps

 

 

Sunil Chauhan
MayilVahanan

HI 

Its depends on the situation.

If its dynamic, backend solution will not work as per requirement. 
If its static, yes, we can proceed with back end script.

 

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
SunilChauhan
Champion
Champion

i dont think its static it work as expected. Currently it s working with refresh of new data too.

thats what we are using recursive function. but lets see how its fit to Question asked 🙂

Sunil Chauhan