6 Replies Latest reply: May 29, 2018 7:07 AM by Tim Poismans RSS

    FirstSortedValue and Aggr

    Tim Poismans

      Hi,

       

      I've been through a few posts already, but I can't seem to figure it out.

       

      I got the following table (which is a visual representation of my aggr measure):

      %WRFINX                   NACPRD                  Measure1

      1530                             2017-11                    0

      1530                             2017-12                    1546

      1530                             2018-01                    1546

      1530                             2018-02                    -1952

      1530                             2018-03                    -1952

       

      Measure1 contains the following measure;

      Aggr(Sum({<PAGEID={'BudgettaireControleDethier'},CCOL1={'TOTAAL'}>}NCOL3),NACPRDNR,[%WRFINX])


      Now I want to have the value returned from Measure1, for the last period(NACPRD). But by using the following:

      FirstSortedValue(Aggr(Sum({<PAGEID={'BudgettaireControleDethier'},CCOL1={'TOTAAL'}>}NCOL3),NACPRDNR,[%WRFINX]),-NACPRDNR)


      it returns Null().


      I'm at a loss of how to retrieve the value from the last NACPRD and would appreciate every help.


      Thanks in advance!



      Kind regards,


      Tim P.