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:
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?
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