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

Minimum date for family

Hello,
I would get a minimum order date on a customer regardless of the family.
Example  :  on the second table, I would only on the two families the minimum date of the client ie the 08 /04/2018 and not two dates.
I used the following formula 

min({<[Big Family]= >} Date)

 but it does not work


Thanks for your helpMINIMUM.JPG

 

1 Solution

Accepted Solutions
sunny_talwar

Is this what you want?

image.png

Expression

Sum(Aggr(If(Min(TOTAL <[ID Customer]> Date) = Date, Occurrence_Client), [ID Customer], [Big Family], Date))

View solution in original post

9 Replies
OmarBenSalem

Maybe

min( TOTAL {<[Big Family]= >} Date)

sunny_talwar

May be this

Aggr(Min(TOTAL <[ID Customer]> Date), [ID Customer], [Big Family])
fredericmante
Partner - Contributor III
Partner - Contributor III

Bonjour,

Try this:

Date(Min(Aggr(min(Date), [Big Family],[ID customer])))

Capture.PNG

Anonymous
Not applicable
Author

thanks a lot 

your formula works at retail 

if ( Aggr(Min(TOTAL <[ID Customer]> Date), [ID Customer], [Big Family])=min(Date), 1,0)

 

 

but not overall, I have the same results between your formula and mine

your formula

sum( {<[ID Customer] = {"=Aggr(Min(TOTAL <[ID Customer]> Date), [ID Customer], [Big Family])=min(Date) "} >} Occurrence_Client)

mine

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

 
it is possible to avoid the "aggr" function for large volumes of data is not recommended

thanks for your help

 

 

sunny_talwar

I don't think you can use set analysis here... may be you need to use FirstSortedValue() function here. Can you elaborate on your goal? What exactly are you trying to capture? 

Anonymous
Not applicable
Author

My goal is to know each client's first order date and attach this order date to the family to make a count. On the other hand, the customer will have to be counted only once. Example if the customer 0001 has a date of order on the 01/08/2018 on the family "A" and another date of order on 11/10/2018 on the family " B ".
This customer must have the value 1 in the family "A" and have the value zero in the family "B".
Is it clearer for you?
Thank you

Anonymous
Not applicable
Author

if it can help you attach my work base

thanks

 

sunny_talwar

Is this what you want?

image.png

Expression

Sum(Aggr(If(Min(TOTAL <[ID Customer]> Date) = Date, Occurrence_Client), [ID Customer], [Big Family], Date))
Anonymous
Not applicable
Author

Perfect

Thanks a lot for your help