Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
PapaJapa
Contributor II
Contributor II

New customers

Hello, I'm having trouble counting new customers. The chart script only shows data for the current month. Formula: "Number of new customers" below:

=count({<Year=, Month=, [CustomerID]= E({<MonthField={"$(=max(MonthField)-1)"}>}), MonthField={"$(=max(MonthField))"} >}distinct [CustomerID])

screen.JPG

I would like the table to be updated with each selection of the month / year range.

Please help.

PapaJapa

2 Replies
jwjackso
Specialist III
Specialist III

Try the Above  function.  If Count(Distinct [CustomerID]) is the number of customers, then Count(Distinct [CustomerID]) - Above(Count(Distinct [CustomerID])) should be the new customers.

sunny_talwar

May be this

Sum(Aggr(
    If([CustomerID] <> Above([CustomerID]), 1, 0)
, [CustomerID], YearField, MonthField))