Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set analysis for cumulative sum

Hi guys,

Consider the following tables:

I am looking for a correct set analysis to sum up the amount spent by the progress date.

Say on 10-01-14 the amount spent should be the sum of expenditure starting 09-01-14. While the amount spent on 02-04-2014 should be the summation of expenditure before and until 02-04-14 (which is 09-01-14 + 02-04-14).

Can somebody show me the correct way to express this using set analysis?

Thank you very much for your kind attention guys.

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try sum(aggr(rangesum(above(sum({<Date=>}Amount),0,rowno())),Date)


talk is cheap, supply exceeds demand

View solution in original post

6 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try sum(aggr(rangesum(above(sum({<Date=>}Amount),0,rowno())),Date)


talk is cheap, supply exceeds demand
Not applicable
Author

Gysbert,

Thank you very much for your kind attention. Got the amount displayed correctly!

Thank you again

Not applicable
Author

Gysbert,

Sorry to disturb you again.

The set analysis is correct if Progress Date not selected.. but say I select Progress Date 21-05-14 the number should show the summation of previous expenditure of date from 09-01-14 till 21-05-14 but it only show the expenditure for date 21-05-14.

Can you suggest a way to rectify this?

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try sum({<Date={"<=$(=max(Date))"}>}aggr(rangesum(above(sum({<Date=>}Amount),0,rowno())),Date)


talk is cheap, supply exceeds demand
Not applicable
Author

Hi Gysbert,

Thank you for your kind attention but it seems to be the same.

Attached is the qvw file for your kind review.

Thank you again

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

If you start using another date dimension then you need to change the expression to reflect that change.


talk is cheap, supply exceeds demand