Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

expression for "New Customer"

Hi all,

I'm looking for a expression where I get a COUNT of "New Customer" back. The definition of "New Customer" is as follow. Each customer, which buy a product in 2012 but NOT has bought it in 2011 is a "New Customer".

Fields in my model:
CustomerName
Jahr (Year)
Sales

I tried it out with the following expression:
COUNT({$<CustomerName = p({$<Jahr={2012}>} CustomerName) - p({$<Jahr={2011}>} CustomerName)>} CustomerName)

I get values but it seems the number of customers are to low.

Thanks for your help!

Jürgen

3 Replies
jvitantonio
Luminary Alumni
Luminary Alumni

I tested the function and it works with no problem. Are you sure you are getting a wrong number of count??

Anonymous
Not applicable
Author

dimension:

=if ( aggr(sum( {$<year= {$(=Only(2012)     )}>} Sales),Client) > 0 ,

if ( aggr(sum( {$<Year= {$(=Only(2012)     )}>} Sales), Client , 0 , 1) , Client)  < 0 , Client ) 

then suppress null value in dimension

Not applicable
Author

Hi alfasierra,

thanks for your support. I tested again and with set filter the figures are correct. Now I want to add to the rule the fact only if sales > 146. My actual expression is like this:

COUNT({$<CustomerName = p({$<Jahr={2012},ArticleClass={Clothes}>} CustomerName) - p({$<Jahr={2011},ArticleClass={Clothes}>} CustomerName)>} CustomerName)

How I can add the rule only if sales is bigger than 146?

Thanks & Kind regards

Jürgen