Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Group Customers (P function) Set Analysis

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)

2 Replies
Not applicable
Author

What is your question?

Anonymous
Not applicable
Author

I want to know if what I'm doing is correct. Because I feel that I'm missing some logic.