<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Display a value associated with a min value in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Display-a-value-associated-with-a-min-value/m-p/223891#M76363</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I found the same question in the forum archives (by &lt;A href="http://community.qlik.com/members/pcorona/default.aspx"&gt;pcorona&lt;/A&gt; on må, jul 6 2009). I tried the recommendations, but couldn't get them to work...so I'm posting the same:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Example:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I have 2 tables with a one to many relationship based on "PatientID". Each unique "PatientID" has many records, each dated with "ApptDate" and other fields, such as "DoctorID" (which can change from record to record for any given patient).&lt;/P&gt;&lt;P&gt;How do I display the "DoctorID" associated with the earliest "ApptID" for a given "PatientID" (so, the doctor that was first ever to see a patient) wtihin a chart/pivot table (with "PatientID" as the dimension)?&lt;/P&gt;&lt;P&gt;My guess:&lt;/P&gt;&lt;P&gt;=if(ApptDate=min(ApptDate),DoctorID)&lt;/P&gt;&lt;P&gt;...this is not working (it only displays "-", however, if there is only one record for the patient, then it works), along with many other variations of the above expression based on similar logic.&lt;/P&gt;&lt;P&gt;What am I doing wrong?&lt;/P&gt;&lt;P&gt;Thanks...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 23 Oct 2009 22:40:35 GMT</pubDate>
    <dc:creator />
    <dc:date>2009-10-23T22:40:35Z</dc:date>
    <item>
      <title>Display a value associated with a min value</title>
      <link>https://community.qlik.com/t5/QlikView/Display-a-value-associated-with-a-min-value/m-p/223891#M76363</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I found the same question in the forum archives (by &lt;A href="http://community.qlik.com/members/pcorona/default.aspx"&gt;pcorona&lt;/A&gt; on må, jul 6 2009). I tried the recommendations, but couldn't get them to work...so I'm posting the same:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Example:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I have 2 tables with a one to many relationship based on "PatientID". Each unique "PatientID" has many records, each dated with "ApptDate" and other fields, such as "DoctorID" (which can change from record to record for any given patient).&lt;/P&gt;&lt;P&gt;How do I display the "DoctorID" associated with the earliest "ApptID" for a given "PatientID" (so, the doctor that was first ever to see a patient) wtihin a chart/pivot table (with "PatientID" as the dimension)?&lt;/P&gt;&lt;P&gt;My guess:&lt;/P&gt;&lt;P&gt;=if(ApptDate=min(ApptDate),DoctorID)&lt;/P&gt;&lt;P&gt;...this is not working (it only displays "-", however, if there is only one record for the patient, then it works), along with many other variations of the above expression based on similar logic.&lt;/P&gt;&lt;P&gt;What am I doing wrong?&lt;/P&gt;&lt;P&gt;Thanks...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Oct 2009 22:40:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Display-a-value-associated-with-a-min-value/m-p/223891#M76363</guid>
      <dc:creator />
      <dc:date>2009-10-23T22:40:35Z</dc:date>
    </item>
    <item>
      <title>Display a value associated with a min value</title>
      <link>https://community.qlik.com/t5/QlikView/Display-a-value-associated-with-a-min-value/m-p/223892#M76364</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Nathanael&lt;/P&gt;&lt;P&gt;I think you need to use the AGGR function around your expression, something like:&lt;/P&gt;&lt;P&gt;=IF(ApptDate = Min ( Aggr ( ApptDate , PatientID ) ) , DoctorID )&lt;/P&gt;&lt;P&gt;I may have got the syntax a little wrong, because its the end of the day on Friday and my brain is frankly fried! If this doesn't work then post an example QVW with a bit of sample data and I'll take a look for you on Monday.&lt;/P&gt;&lt;P&gt;Have a great weekend,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Oct 2009 23:03:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Display-a-value-associated-with-a-min-value/m-p/223892#M76364</guid>
      <dc:creator />
      <dc:date>2009-10-23T23:03:04Z</dc:date>
    </item>
    <item>
      <title>Display a value associated with a min value</title>
      <link>https://community.qlik.com/t5/QlikView/Display-a-value-associated-with-a-min-value/m-p/223893#M76365</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you managed to complete your script?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jun 2010 16:27:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Display-a-value-associated-with-a-min-value/m-p/223893#M76365</guid>
      <dc:creator />
      <dc:date>2010-06-02T16:27:49Z</dc:date>
    </item>
  </channel>
</rss>

