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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

AGGR function

I'd like to write an expression that calculates some values based on a sort order that is specified in the expression:

If I have a "flag" on my data that is 0 or 1. In a table I can use the following expression which sums the flag for every row that is above the "current" row:

rangesum(above(TOTAL Sum(leave_flag),0,rowno(TOTAL)))


This works just fine when I sort my table on anything I like. I would like an expression that forces the calculation to be based on another specific column (lets say it is a column called "sales").


I have come across the AGGR function which allows you to do this but I can't work out how to use it do what I want. Should it be immediately before the rangesum function or the above function. Do I even need the above function?


Can anyone help?

1 Reply
sunny_talwar
MVP
MVP

Look here:

Recipe for a Pareto Analysis – Revisited

This gives an example where you sort by Sum(Measure) in the Aggr() function. But please note that this is only available in QV12.1 or above and Qlik Sense