<?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 Re: Get value for record with most recent date in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Get-value-for-record-with-most-recent-date/m-p/45345#M3067</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;With PatientID as a dimension, you can use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=&lt;EM&gt;FirstSortedValue(ObservationValue, -ObservationDate)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;to find the most recent observation value&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 03 May 2018 05:07:48 GMT</pubDate>
    <dc:creator>jonathandienst</dc:creator>
    <dc:date>2018-05-03T05:07:48Z</dc:date>
    <item>
      <title>Get value for record with most recent date</title>
      <link>https://community.qlik.com/t5/App-Development/Get-value-for-record-with-most-recent-date/m-p/45344#M3066</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have an app with one table with blood pressure readings for many patients. FIelds are PatientID, ObservationValue, ObservationDate, and RowID (created using RowNo()).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to show a table with every PatientID and his/her most recent ObservationValue (based on ObservationDate).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PatientID is a dimension in the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried various ways to get the ObservationValue, to no avail:&lt;/P&gt;&lt;P&gt;=max({$&amp;lt;ObservationDate={"$(=max(aggr(max(ObservationDate), PatientID))"} &amp;gt;} ObservationValue)&lt;/P&gt;&lt;P&gt;=max({$&amp;lt;ObservationDate={"$(=aggr(max(ObservationDate), PatientID)"} &amp;gt;} ObservationValue)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; and as a dimension:&lt;/P&gt;&lt;P&gt;=Aggr(max({$&amp;lt;ObservationDate={"$(=aggr(max(ObservationDate), PatientID)"} &amp;gt;} ObservationValue), PatientID)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above all return null.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This returns each patient's max(ObservationValue) and ignores the ObservationDate, so it's wrong:&lt;/P&gt;&lt;P&gt;=max({$&amp;lt;ObservationDate={"=$(=max(ObservationDate))"} &amp;gt;} num(ObservationValue))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I must be over-complicating this... &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 May 2018 03:21:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Get-value-for-record-with-most-recent-date/m-p/45344#M3066</guid>
      <dc:creator>Lauri</dc:creator>
      <dc:date>2018-05-03T03:21:04Z</dc:date>
    </item>
    <item>
      <title>Re: Get value for record with most recent date</title>
      <link>https://community.qlik.com/t5/App-Development/Get-value-for-record-with-most-recent-date/m-p/45345#M3067</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;With PatientID as a dimension, you can use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=&lt;EM&gt;FirstSortedValue(ObservationValue, -ObservationDate)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;to find the most recent observation value&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 May 2018 05:07:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Get-value-for-record-with-most-recent-date/m-p/45345#M3067</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2018-05-03T05:07:48Z</dc:date>
    </item>
    <item>
      <title>Re: Get value for record with most recent date</title>
      <link>https://community.qlik.com/t5/App-Development/Get-value-for-record-with-most-recent-date/m-p/45346#M3068</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes! Thanks so much, Jonathan. I figured there had to be a simpler solution!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 May 2018 13:02:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Get-value-for-record-with-most-recent-date/m-p/45346#M3068</guid>
      <dc:creator>Lauri</dc:creator>
      <dc:date>2018-05-03T13:02:56Z</dc:date>
    </item>
  </channel>
</rss>

