Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Jacob_Weig
Contributor III
Contributor III

Cumulative sum on all dates

Hello, 

I am trying to create a table that does a cumulative sum like this:

id date cumulative sum
53302 2022-06-12 148.61
53302 2022-06-13 297.22
53302 2022-06-14 297.22

 

What is important to note here is that I need the cumulative sum on ALL the dates of the calendar. Any ideas?

Labels (2)
4 Replies
Gui_Approbato
Creator III
Creator III

If you just need to add a column in this table, try this:

RangeSum(Above(Sum(Sales), 0, RowNo( )  )   )

In order for this to work the tables needs to be sorted by date.

vinieme12
Champion III
Champion III

Jacob_Weig
Contributor III
Contributor III
Author

Hello Gui,

How about it if I need to partition by the id?

Thanks, 

Marcela

Gui_Approbato
Creator III
Creator III

Hi Marcela,

It will depend on the sorting you want to prioritize..

You can add new dimensions but the calculation will be messed up according to the sorting, because it takes the records from the previous row and adds up until the end (that is why we have the ABOVE function there).

Check this post, see if it helps: https://community.qlik.com/t5/Qlik-Design-Blog/Recipe-for-a-Pareto-Analysis-Revisited/ba-p/1473684