Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

First purchase et Second purchase

 

Hello

I have a file containing dates, families of products and customers. I would know about each family the number of customers who ordered a first (minimum date)

I have done this and  it's work

sum( {<[ID Customer] = {"=min(Date)"} >}  Nb_customer)

and the number of customers who ordered a second time by super family.

sum( {<[ID Customer] = {"=min(Date), [Big Family]={'FORME & BEAUTE'}" } >} Nb_Customer)

the goal is to reach this but with  my second calculation everything is at zero

 

Big Familysum(Turnover)First purchaseSecond purchase MAISON ET ENTRETIENSecond purchase BRICOLAGESecond purchase CUISINESecond purchase FORME & BEAUTE
MAISON ET ENTRETIEN646,7924590000
BRICOLAGE689,14223160300
CUISINE3707,0812330060
FORME & BEAUTE11957,2618914800030

 

thanks for your help

 

6 Replies
Anil_Babu_Samineni

For me, Quiet syntax wrong. Try this?

sum( {<[ID Customer] = {$(=min(Date))}, [Big Family]={'FORME & BEAUTE'} >} Nb_Customer)

Or

sum( {<Date = {$(=min(Date))}, [Big Family]={'FORME & BEAUTE'} >} Nb_Customer)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
tresesco
MVP
MVP

Your first expression itself seems to be wrong. When you write -  sum( {<[ID Customer] = {"=min(Date)"} >}  Nb_customer) that means you are comparing customer ID with a date value, which is potentially wrong. Correct way of writing similar set expression would be something like:  sum( {<Date = {'$(Date(min(Date))'} >}  Nb_customer)

 

If you could share a sample app to work on, we could help you better.

Anonymous
Not applicable
Author

Hello

You're right, this is what i would like in reality 

Capture.JPG

thanks a lot

 

 

 

 

Anonymous
Not applicable
Author

Sorry,

I was wrong about my calculations, i published a correction

 

thanks

 

 

tresesco
MVP
MVP

Like this?

Count( {<Date = {'$(=Date(min(Date)))'}>} Occurrence_Client)

Count( {<Date = {'$(=Date(min(Date,2)))'}>} Occurrence_Client)

Count( {<Date = {'$(=Date(min(Date,3)))'}>} Occurrence_Client)

 

PFA as well.


Anonymous
Not applicable
Author

thanks

it works well on a client

r1.JPG

but over a period it does not work.

r2.JPG

I have too few results because i have 191 customers

 

thanks for your help