4 Replies Latest reply: Jul 12, 2016 12:35 PM by vibol chea RSS

    Firstsortedvalue

    vibol chea

      Hello,

       

      I am trying to pick most recent date from Order table by Date and Product, but I have run into a problem when an item appears on multiple lines.

       

      Here's an example when my script fails:

       

      date(FirstSortedValue(InvoiceDate,-if(InvoiceDate >= monthstart(AddMonths(today(),-6)), InvoiceDate)))

       

      Product     InvoiceDate

      505ABC     07/08/2016

      505ABC     07/08/2016

       

      How do I tell it to pick the most recent or just one from each date.

       

      Thanks

       

      Vibol