Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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 | ||
Customers | Sales | Discount |
C1 | 10.000 | - |
- | - | - |
C3 | 15.000 | 200 |
C4 | 4.000 | 100 |
2014 | ||
Customers | Sales | Discount |
C1 | 10.000 | 3.000 |
C2 | 10.000 | 2.000 |
C3 | 8.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)
What is your question?
I want to know if what I'm doing is correct. Because I feel that I'm missing some logic.