2 Replies Latest reply: May 11, 2011 5:53 AM by jmpatino RSS

    Help with advanced aggr

      Hi,

       

      I looking for a way to get the first/last invoice value of a customer:

      For example: Given this table

       

      Customer
      OrderDateProduct
      Value
      A1/1/2011A30
      B1/1/2010B30
      B1/1/2010C40
      C1/1/2011D30
      C1/1/2010E40

       

      I want to create a report with

      CustomerMax(OrderDate)
      Latest Order Value
      A1/1/201130
      B1/1/201070
      C1/1/201130

       

      I have tried:

      firstSortedValue(aggr(sum(Sales), OrderDate, Customer), -OrderDate)

       

      Am I doing something wrong?

       

      Thank you in advance

      JM Patino