2 Replies Latest reply: Feb 16, 2014 7:55 PM by Juan Escobar RSS

    Group Customers (P function) Set Analysis

    Juan Escobar

      I need to bring all the customers who have discount today, then I need to match those customers who bought last year same month (it doesn't matter if the had discount). And see how many of them match.

       

      Example:

       

      2013
      CustomersSalesDiscount
      C110.000-
      ---
      C315.000200
      C44.000100

       

      2014
      CustomersSalesDiscount
      C110.0003.000
      C210.0002.000
      C38.000-
      ---

       

      The customers of 2014 are C1 and C2, and the customer that match is just C1... I need to get to that result. So I can compare all the sales of those customers with discount this year with last year if the did bought something.

       

      I'm using this set analysis to count the customers, and for the sales I just change the "count" to "sum" and "DISTINCT Cod_Cliente" for "Volumen":

       

      Count({<Cod_Cliente = P({1<Año = {$(vMaxYear)}, Mes = {$(vMaxMonth)}, Flag_Descuento_Mainstream = {1}>} Cod_Cliente), Año = {$(vPriorYear)}, Mes = {$(vMaxMonth)}>} DISTINCT Cod_Cliente)