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

How to get MIN() value and its relative fields using expression?

Hi All,

I have the following problem where I am not able to get the values for a minimum date value field for each customer.

I have a table as follows:

CustomerFirst Service DateNext Service Date
109/01/201409/02/2014
109/02/201409/10/2014
109/10/2014-
209/02/201409/14/2014
209/14/2014-
309/10/201409/17/2014
309/17/2014-

I have derived the minimum of 'First Service Date' for each customer using the expression:

=Date(Min([First Service Date], [Customer]), 'MM/DD/YYYY') but not able to get the corresponding 'Next Service Date' value.

Now I want to find the minimum of 'First Service Date' for each customer and then its corresponding 'Next Service Date'. I want the output as follows:

CustomerFirst Service DateNext Service Date
109/01/201409/02/2014
209/02/201409/14/2014
309/10/201409/17/2014

Your inputs are appreciated.

Thanks!!!!!!

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Try firstsortedvalue([Next Service Date],[First Service Date])


talk is cheap, supply exceeds demand

View solution in original post

3 Replies
Gysbert_Wassenaar

Try firstsortedvalue([Next Service Date],[First Service Date])


talk is cheap, supply exceeds demand
MK_QSL
MVP
MVP

FirstSortedValue([Next Service Date],Aggr(MIN([First Service Date]),Customer))

Not applicable
Author

Thank you!!!!