10 Replies Latest reply: Sep 6, 2013 9:40 AM by Erik Furlanis RSS

    [set analysis] Sort by highest quantity in most recent timestamp

      Dear all


      I am quite familiarised with the Set Analysis, but yet there is something simple that I am not able to achieve.

      Been giving it a try in these last two weeks, but I'am giving up!


      Basically, my source is SKU, quantity, timestamp

      What I want to visualise, in a pivot chart, is the trend of quantity available for each SKU over time.

      And I would like the SKU to be sorted descending according to the SKU which has the highest quantity for the most recent timestamp


      I tried with something like this (in Sort>Expression)


      =sum({$<BO_KPI.TimeStamp={$(=max(BO_KPI.TimeStamp))}>}   BO_KPI.Qty)


      which is a pretty straightforward set analysis, but apparently I still manage to do something wrong, as SKUs are sorted in a random way (or in a way with no apparent logic).

      Can someone pls help me sort this out?


      Thanks already!