5 Replies Latest reply: Aug 10, 2012 10:10 AM by Jose Tos RSS

    Help set analysis

    Giorgia Michieli

      Hello everybody,

      I'm trying to build a function that I pull out, per customer, the last date on which he purchased, and on that date, the item purchased with the highest economic value. That is the record with the highest value of the last sale per customer.

       

      I wrote something like this, but it doesn't work.

      sum({<DATA_DDT={$( aggr(max(DATA_DDT),C_CLIENTE))}>} aggr(max({<DDT_SN={'S'}>}VAL_DDT),C_CLIENTE,C_ARTICOLO))

       

      DATA_DDT is the date

      C_CLIENTE is the customer code

      C_ARTICOLO is the article code

      VAL_DDT is the article value €

      DDT_SN is only a flag to reduce data, it's not important

       

      Can you help me?