Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
ToJu
Contributor II
Contributor II

"Recovered customers"

Hello everybody,

I have a question regarding the following situation.

The data are as follows:

CustomerInvoiceDateSALES
0012301.07.2012200 €
9726215.06.2013300 €
4567717.08.201750 €
2314218.09.2019100 €
4253121.01.2021150 €
...  

 

Now we'd like to count the "recovered customers" (KPI). A recovered customer has to fulfill three conditions:

1) Sales before 31.12.2017

2) No Sales between 01.01.2018 and 31.12.2020

3) Sales after 01.01.2021

What formula would you recommend?

Thank you very much in advance!

1 Solution

Accepted Solutions
Taoufiq_Zarra

May be like this :

=count({<Customer={"=sum({<InvoiceDate={[<31.12.2017]}>} Sales)>0"}*{"=sum({<InvoiceDate={[>01.01.2018 <01.12.2020]}>} Sales)>0"}*{"=sum({<InvoiceDate={[>01.01.2021]}>} Sales)>0"}>} distinct Customer)

output:

Taoufiq_Zarra_0-1630189086960.png

 

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉

View solution in original post

6 Replies
Taoufiq_Zarra

@ToJu  try this :

=sum({<InvoiceDate={"<31.12.2017"}>} SALES)

 

=count({<InvoiceDate={">01.01.2018 <01.12.2020"}>} Customer)

 

=sum({<InvoiceDate={">01.01.2021"}>} SALES)

 

output

Taoufiq_Zarra_0-1629990630467.png

 

:

 

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
ToJu
Contributor II
Contributor II
Author

@Taoufiq_Zarra Thank you very much!

But I need to count the customers, if all three conditions are true.

Is it possible to combine these formulas?

Taoufiq_Zarra

@ToJu  can you share the expected output from this sample ?

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
ToJu
Contributor II
Contributor II
Author

Let’s have a look at the following table:

CustomerInvoiceDateSales
12301.06.2012100 €
12301.10.2019200 €
12301.03.2021300 €
45601.09.201350 €
45601.04.2021250 €

 

The expected output from this example should be "1" (--> 456), because:

- Customer 456 fulfills every condition

- Customer 123 doesn't fulfill condition 2 (there are sales between 01/2018 and 12/2020)

Taoufiq_Zarra

May be like this :

=count({<Customer={"=sum({<InvoiceDate={[<31.12.2017]}>} Sales)>0"}*{"=sum({<InvoiceDate={[>01.01.2018 <01.12.2020]}>} Sales)>0"}*{"=sum({<InvoiceDate={[>01.01.2021]}>} Sales)>0"}>} distinct Customer)

output:

Taoufiq_Zarra_0-1630189086960.png

 

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
ToJu
Contributor II
Contributor II
Author

That's it. Thank you very much! 🙂