10 Replies Latest reply: May 2, 2017 2:35 AM by Rubandoss H RSS

    Problem with firstsortedvalue

    Marco van Zand

      Hey All,

       

      I'm looking for the first date with the max occupancy. The table with the input is;

      ItemnrDateOccupancy
      A1-1-2016200
      A2-1-2016220
      A3-1-2016220
      A4-1-2016200
      A5-1-2016180
      B1-1-2016150
      B2-1-2016175
      B3-1-2016180
      B4-1-2016180
      B5-1-2016170

       

      What I'm looking for is

      ItemnrDateOccupancy
      A2-1-2016220
      B3-1-2016180

       

      Function does work for itemnr with only 1 date with the max occupancy. Function so far is;

       

      Firstsortedvalue(Date,-Aggr(sum(Occupancy),Date)