Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Community,
How to find second purchase product to find for the below scenario. So here
my out put should be like this
Customer | Product |
A | Cap |
B | Fant |
E | Calc |
E | XXXXX |
Data:
Customer | Product | Date |
A | Pen | 1/1/2019 |
A | Cap | 2/1/2019 |
B | Shirt | 2/1/2019 |
B | Trouser | 2/1/2019 |
B | Fant | 3/1/2019 |
C | xxx | 2/1/2019 |
D | Yyy | 3/1/2019 |
E | Com | 2/1/2019 |
E | Calc | 3/1/2019 |
E | Pillo | 2/1/2019 |
E | XXXXX | 3/1/2019 |
Please help us to find the solution.
_Priya
Try this
Dimension
Customer Product
Expression
Aggr(If(Date = Max(TOTAL <Customer> Date) and Count(TOTAL <Customer> DISTINCT Product&Date) > 1, 1), Customer, Product, Date)
Hi,
maybe this part of your expression already suffices:
Date = Min(TOTAL <Customer> Date,2)
(keeping the same dimensions)
hope this helps
regards
Marco
Try this
Dimension
Customer Product
Expression
Aggr(If(Date = Max(TOTAL <Customer> Date) and Count(TOTAL <Customer> DISTINCT Product&Date) > 1, 1), Customer, Product, Date)
Thanks Sunny,
It works if we have 2 dates only for ex below data we have 3 dates.
Here we should get Product_2 as it purchased on second date but as per your expr we are getting Product_3.
Cust_A | Product_1 | 9/1/2019 |
Cust_A | Product_2 | 10/1/2019 |
Cust_A | Product_3 | 11/1/2019 |
Hi,
maybe this part of your expression already suffices:
Date = Min(TOTAL <Customer> Date,2)
(keeping the same dimensions)
hope this helps
regards
Marco