<?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: QlikView FirstSortedValue not giving latest record with Aggr and Count added in the expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/QlikView-FirstSortedValue-not-giving-latest-record-with-Aggr-and/m-p/1976108#M1220760</link>
    <description>&lt;P&gt;tagging&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/46628"&gt;@sunny_talwar&lt;/a&gt; and &lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/22949"&gt;@tresB&lt;/a&gt;&amp;nbsp;&amp;nbsp;for a suggestion.. Thanks&lt;/P&gt;</description>
    <pubDate>Fri, 02 Sep 2022 12:38:39 GMT</pubDate>
    <dc:creator>MK_2022</dc:creator>
    <dc:date>2022-09-02T12:38:39Z</dc:date>
    <item>
      <title>QlikView FirstSortedValue not giving latest record with Aggr and Count added in the expression</title>
      <link>https://community.qlik.com/t5/QlikView/QlikView-FirstSortedValue-not-giving-latest-record-with-Aggr-and/m-p/1976085#M1220758</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;IMMEDIATE REQUIREMENT : APPRECIATIVE OF ALL THE HELP..!!!!&lt;/P&gt;
&lt;P&gt;I have been struggling to make this expression work on bar chart. Attached is the sample data set and Im trying to get the Riskcategory a Patient is attached to for the latest discharge date(Least GraphRank) within the selected timeframe.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Expression :&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Count(Aggr(FirstSortedValue(total &amp;lt;PatientID&amp;gt; {&amp;lt;PeriodType={"Rolling 12"},AsOfPeriod={"$(vMaxAsOfPeriod)"}&amp;gt;}distinct GraphRank, YTDRollingwithRisk),PatientID)) )&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;vMaxAsOfPeriod is defined as&amp;nbsp;= max(AsOfPeriod)&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the inside expression of&amp;nbsp;FirstSortedValue(total &amp;lt;PatientID&amp;gt; {&amp;lt;PeriodType={"Rolling 12"},AsOfPeriod={"$(vMaxAsOfPeriod)"}&amp;gt;}distinct GraphRank, YTDRollingwithRisk) is giving the correct value which is the lowest graph rank within selected timeframe for each patient but when I add the Count and Aggr on top of it, gives me the Riskcategory of Oldest GraphRank instead of the latest.&lt;/P&gt;
&lt;P&gt;for PeriodType of Rolling 12 and AsofPeriod 202007 the expected result is as below:&lt;/P&gt;
&lt;P&gt;Shared Risk : 6, FFS : 3 and Full Risk : 2&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MK_2022_0-1662078618291.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/88111i70BFE05E1DB3602D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MK_2022_0-1662078618291.png" alt="MK_2022_0-1662078618291.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Instead Im getting as below which is the category of the oldest GraphRank outside of 202207 and Rolling12.Looks like its not even taking setanalysis into consideration.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MK_2022_1-1662078852622.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/88112i8555B56D9615AD07/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MK_2022_1-1662078852622.png" alt="MK_2022_1-1662078852622.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please let me know if Im doing anything wrong within the expression or an alternative way..!!&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 02 Sep 2022 00:36:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/QlikView-FirstSortedValue-not-giving-latest-record-with-Aggr-and/m-p/1976085#M1220758</guid>
      <dc:creator>MK_2022</dc:creator>
      <dc:date>2022-09-02T00:36:55Z</dc:date>
    </item>
    <item>
      <title>Re: QlikView FirstSortedValue not giving latest record with Aggr and Count added in the expression</title>
      <link>https://community.qlik.com/t5/QlikView/QlikView-FirstSortedValue-not-giving-latest-record-with-Aggr-and/m-p/1976108#M1220760</link>
      <description>&lt;P&gt;tagging&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/46628"&gt;@sunny_talwar&lt;/a&gt; and &lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/22949"&gt;@tresB&lt;/a&gt;&amp;nbsp;&amp;nbsp;for a suggestion.. Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 02 Sep 2022 12:38:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/QlikView-FirstSortedValue-not-giving-latest-record-with-Aggr-and/m-p/1976108#M1220760</guid>
      <dc:creator>MK_2022</dc:creator>
      <dc:date>2022-09-02T12:38:39Z</dc:date>
    </item>
    <item>
      <title>Re: QlikView FirstSortedValue not giving latest record with Aggr and Count added in the expression</title>
      <link>https://community.qlik.com/t5/QlikView/QlikView-FirstSortedValue-not-giving-latest-record-with-Aggr-and/m-p/1979082#M1220914</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/163453"&gt;@MK_2022&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Could you please share a qvw file with sample data. Also bit more logical explanation would help. Unfortunately I could not replicate the output with the sample data you shared. &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Sep 2022 07:25:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/QlikView-FirstSortedValue-not-giving-latest-record-with-Aggr-and/m-p/1979082#M1220914</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2022-09-09T07:25:29Z</dc:date>
    </item>
    <item>
      <title>Re: QlikView FirstSortedValue not giving latest record with Aggr and Count added in the expression</title>
      <link>https://community.qlik.com/t5/QlikView/QlikView-FirstSortedValue-not-giving-latest-record-with-Aggr-and/m-p/1979377#M1220933</link>
      <description>&lt;P&gt;It looks like your expression has one too many closing parenthesis. This is what I get when I apply your expression in a horizontal bar chart, sorted by Numeric Value descending. I did have to select the max AsOfPeriod though. Is that not what you want?&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohnInSD_0-1662747778143.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/88829iFD13943CB3CA9DB5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JohnInSD_0-1662747778143.png" alt="JohnInSD_0-1662747778143.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;HTH,&lt;/P&gt;
&lt;P&gt;JohnInSD&lt;/P&gt;
&lt;P&gt;(aka johncaqc)&lt;/P&gt;</description>
      <pubDate>Fri, 09 Sep 2022 18:26:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/QlikView-FirstSortedValue-not-giving-latest-record-with-Aggr-and/m-p/1979377#M1220933</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-09T18:26:07Z</dc:date>
    </item>
  </channel>
</rss>

