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: 
stascher
Partner - Creator II
Partner - Creator II

Finding column value associated with minimum value in another column

Hello,

This should be fairly easy.  Given the following table:

SubjectVisit DateVisit Reason

Arty

1/1/2001Alpha
Arty2/2/2002Beta
Arty3/3/2003Delta
Betty1/15/2015
Betty2/16/2016Biff

I want to create a Table Listing of Subjects with the date of their first visit and, if provided, the visit reason concatenated to the date. Ex:

Header 1Header 2
Arty1/1/2001 - Alpha
Betty1/15/2015

I've got my Table Listing defined with Subject as Dimension #1, and I can define min([Visit Date]) to get the first visit, but I'm not sure of the rest of the expression I need to get the Visit Reason associated with that date.

Thanks for any help.

Steve

1 Solution

Accepted Solutions
sunny_talwar

Try this

Dimension

Subject

Expression

Date(Max([Visit Date])) & ' - ' & FirstSortedValue([Visit Reason], [Visit Date])

View solution in original post

2 Replies
sunny_talwar

Try this

Dimension

Subject

Expression

Date(Max([Visit Date])) & ' - ' & FirstSortedValue([Visit Reason], [Visit Date])

stascher
Partner - Creator II
Partner - Creator II
Author

Once again, Sunny to the rescue!

I'd never heard of the FirstSortedValue function before, so I learned something new today.

Thank you very much!