1 Reply Latest reply: Jul 20, 2017 7:23 AM by Sunny Talwar RSS

    AGGR function

    David Pardoe

      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?