8 Replies Latest reply: May 17, 2017 10:25 AM by Guy Hombleu

# Count new customers per month by expression

Hi guys,

Is there a way to calculate the number of new customers per month by expression.

During business rules I cant change the scripting, so I need to calculate the number of new customers per month by expression.

Is there someone who could help me with this?

Thnx!

• ###### Re: Count new customers per month by expression

Hi Vineeth,

Here's the table with and calculations:

New Customers: =count({< %KUNNR_Key = e({<calendar.Year -={'2017'}>}%KUNNR_Key) >} distinct %KUNNR_Key)

Lost Customers: =count({< %KUNNR_Key ={"=min(TOTAL <%KUNNR_Key> Year)=2017"} >} distinct %KUNNR_Key)

All Customers:  =Count( DISTINCT %KUNNR_Key)

Can you give me some advice whats going wrong??

• ###### Re: Count new customers per month by expression

can you post a sample app?

• ###### Re: Count new customers per month by expression

Heres the sample

vinieme12

Would be superb if you could fix the calculations.

• ###### Re: Count new customers per month by expression

what is the expected output? also what is the logic that you are trying to implement

• ###### Re: Count new customers per month by expression

New customers : Count the number of customer which placed their first order in this month

Lost customers : Count the number of customers which didnt placed an order in the current month, but placed their last order in the previous month

Amount New customers: The total amount of turnover brought by New Customers

This should be the outcome

• ###### Re: Count new customers per month by expression

what i could spot was incorrect field name in red below

Lost Customers: =count({< %KUNNR_Key ={"=min(TOTAL <%KUNNR_Key> calendar.Year)=2017"} >} distinct %KUNNR_Key)