5 Replies Latest reply: Nov 29, 2016 4:54 PM by Stefan Wühl RSS

    Date of aggr formula

    Henrique Demarco


      I have a formula to return maximum value exposed in a customer:

      Max(Aggr(Sum(If([Issue Date]<=Date,[Billed amount]))-Sum(If([Payment Date]<=Date,[Paid amount])),Date))

      This sum all billed amount before a date and subtract all paid amount before the same date.

      Aggr gives me an statement with balance (Billed amount - Paid amount) day after day (Date).

      Columns are: Date, Billed amount, Paid amount, Balance


      First objective was to get highest balance value. That is done.

      Secondary is to get last Date when highest balance occurs (I am considering the possibility of having same balance for more than one row).

      How to get this 'last Date'? I already tried Firstsortedvalue but not luck.

      Thanks in advance.