Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
i would like to select a customer and be able to see how many days go between the last sale and the previous one.
Thanks.
@Carlaf_93 I understood no need to do a set analysis.
for exampe :
if I selected A as customer :
max(date)->14/06/2020
previous one->01/05/2020
So to calculate nbr of days u can use :
=Floor(Date(Max(Date)))-Floor(Date(Max(Date,2)))
Can you share with me how you calculate 33, because :
between 19/03 and 12/02 ->35 days
between 23/04 and 19/03 ->35 days
between 23/05 and 23/04 ->30 days
between 19/06 and 23/05 ->27 days
the avg thus is 31.75
Script:
=Avg(
aggr(
floor(DATE_A)-floor(above(DATE_A))
,CUSTOMER,DATE_A
)
)
@Carlaf_93 I understood no need to do a set analysis.
for exampe :
if I selected A as customer :
max(date)->14/06/2020
previous one->01/05/2020
So to calculate nbr of days u can use :
=Floor(Date(Max(Date)))-Floor(Date(Max(Date,2)))
Thank you!
And if i want the average number of days between all the sales of one customer?
can you share a sample data and the expected value of the avg ?
LOAD * INLINE [
DATE_A, CUSTOMER, SALES,
12/02/2019, A, 3,
19/03/2019, A, 30,
23/04/2019, A, 7,
23/05/2019, A, 7,
19/06/2019, A, 3,
];
I expect an average of 33 days for customer A
Can you share with me how you calculate 33, because :
between 19/03 and 12/02 ->35 days
between 23/04 and 19/03 ->35 days
between 23/05 and 23/04 ->30 days
between 19/06 and 23/05 ->27 days
the avg thus is 31.75
Script:
=Avg(
aggr(
floor(DATE_A)-floor(above(DATE_A))
,CUSTOMER,DATE_A
)
)