Qlik Community

Qlik Sense App Development

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

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

Re: AGGR function

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

Community Browser