<?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: Set Analysis with FirstSortedValue in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Set-Analysis-with-FirstSortedValue/m-p/1824802#M67751</link>
    <description>&lt;P&gt;HI,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try below expression&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;count({DISTINCT&amp;lt;&amp;nbsp;PatientID={" =Aggr(FirstSortedValue({&amp;lt;IsSameYear={1}, FactType={BP}&amp;gt;} [BP SYSTOLIC], -Date),PatientID)&amp;lt;140"}&amp;gt;}PatientID)&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 27 Jul 2021 11:25:29 GMT</pubDate>
    <dc:creator>sasikanth</dc:creator>
    <dc:date>2021-07-27T11:25:29Z</dc:date>
    <item>
      <title>Set Analysis with FirstSortedValue</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-with-FirstSortedValue/m-p/1824649#M67723</link>
      <description>&lt;P&gt;I'd like to count the number of patients whose last blood pressure in the year was below 140. I am able to find the value of the last blood pressure like this in a chart:&lt;/P&gt;&lt;P&gt;=FirstSortedValue({&amp;lt;IsSameYear={1}, FactType={BP}&amp;gt;} [BP SYSTOLIC], -Date)&lt;/P&gt;&lt;P&gt;This correctly returns the value every time.&lt;/P&gt;&lt;P&gt;When I try to count patients for whom this is true, it does not work. My measure:&lt;/P&gt;&lt;P&gt;=Count(distinct {&amp;lt;PatientID={"=(FirstSortedValue({&amp;lt;IsSameYear={1}, FactType={BP}&amp;gt;} [BP SYSTOLIC], -Date)&amp;lt;140)"}&amp;gt;} PatientID)&lt;/P&gt;&lt;P&gt;Any clues why this does not work?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jul 2021 03:11:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-with-FirstSortedValue/m-p/1824649#M67723</guid>
      <dc:creator>Lauri</dc:creator>
      <dc:date>2021-07-27T03:11:48Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis with FirstSortedValue</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-with-FirstSortedValue/m-p/1824651#M67724</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Try like below&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Sum(Aggr(If(FirstSortedValue({&amp;lt;IsSameYear={1}, FactType={BP}&amp;gt;} [BP SYSTOLIC], -Date) &amp;lt; 140, 1), PatientID))&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jul 2021 03:54:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-with-FirstSortedValue/m-p/1824651#M67724</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2021-07-27T03:54:05Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis with FirstSortedValue</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-with-FirstSortedValue/m-p/1824802#M67751</link>
      <description>&lt;P&gt;HI,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try below expression&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;count({DISTINCT&amp;lt;&amp;nbsp;PatientID={" =Aggr(FirstSortedValue({&amp;lt;IsSameYear={1}, FactType={BP}&amp;gt;} [BP SYSTOLIC], -Date),PatientID)&amp;lt;140"}&amp;gt;}PatientID)&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jul 2021 11:25:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-with-FirstSortedValue/m-p/1824802#M67751</guid>
      <dc:creator>sasikanth</dc:creator>
      <dc:date>2021-07-27T11:25:29Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis with FirstSortedValue</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-with-FirstSortedValue/m-p/1824877#M67758</link>
      <description>&lt;P&gt;Thank you both, Sasi and Mayil. You got me on the right track with Aggr, this way:&lt;/P&gt;&lt;P&gt;count(DISTINCT&amp;nbsp;If(aggr({&amp;lt;IsSameYear={1}, AsOfYear&amp;gt;} FirstSortedValue({&amp;lt;IsSameYear={1}, FactType={BP}&amp;gt;} [BP SYSTOLIC], -Date), PatientID, AsOfYear)&amp;lt;140, PatientID))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jul 2021 14:26:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-with-FirstSortedValue/m-p/1824877#M67758</guid>
      <dc:creator>Lauri</dc:creator>
      <dc:date>2021-07-27T14:26:27Z</dc:date>
    </item>
  </channel>
</rss>

