Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
joboro
Contributor III
Contributor III

Cumulative sum over date ascending but order descending

Hi, I have the following source table:

date quantity
2021-01-01 1
2021-01-02 1
2021-01-03 4
2021-01-04 9

 

I would like to have the following table:

date quantity accum_quantity
2021-01-04 9 15
2021-01-03 4 6
2021-01-02 1 2
2021-01-01 1 1

 

What set analysis should is use for "accum_quantity"? If the output table would be sorted by date ascending i could use the formula: 

Rangesum(ABOVE(Sum(QUANTITY),0,rowno()))

 The best case would be that the sum is independent from the sort order of the table...

KR

Labels (3)
11 Replies
joboro
Contributor III
Contributor III
Author

Thanks for the link, but i tried that already when i searched for a solution. Even when i use above in the set expression the column is still sortable.

SunilChauhan
Champion II
Champion II

i Have no idea .

One last this you Can try {1} in Sum or Range sum.

Sunil Chauhan