Qlik Community

App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
QlikWorld online is next week! REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
crossroadsit
Contributor II
Contributor II

Ignore current selections within an aggr function

In Qlik Sense I'm using the following function as a measure to get a cumulative chart with two dimensions.

=aggr(rangesum(above(sum(TotalAmount), 0, rowno() )), Time.Year, [Time.Year Week])

That is working well and produces the graph shown below (I'm using some simple IF statements in the dimensions to constrain them to current/previous years and weeks to date).

Now I want to use set analysis to ignore current selections in the values. I can't figure out how to modify the function above to achieve that. Any suggestions?

2015-02-28_0222.png

1 Solution

Accepted Solutions
Gysbert_Wassenaar

=sum({1}aggr(rangesum(above(sum({1}TotalAmount), 0, rowno() )), Time.Year, [Time.Year Week]))


talk is cheap, supply exceeds demand

View solution in original post

3 Replies
Gysbert_Wassenaar

=sum({1}aggr(rangesum(above(sum({1}TotalAmount), 0, rowno() )), Time.Year, [Time.Year Week]))


talk is cheap, supply exceeds demand
crossroadsit
Contributor II
Contributor II
Author

Thanks Gysbert,

If I'm honest, I don't know exactly why the solution involved putting a sum() around all of it... but it does feel right and it does work.

I had tried putting {1} before TotalAmount. My grasp of set analysis, aggr and rangesum is still a bit tenuous.

Best,

Matt

colinodonnel
Creator
Creator

Adding a prefix of Sum({1} to the aggr function is still a solution in 2020.

Thanks