<?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 Firstsortedvalue in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Firstsortedvalue/m-p/1705393#M54079</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;How would you approach this scenario? I'm working with Covid19 data and currently I would like to use firstsortedvalue to print the second worst affected US state by cases and its case number.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm getting the worst affected state and its correct case count done with this. Note that data is a few weeks old.&amp;nbsp;&lt;/P&gt;&lt;P&gt;'Most Affected State by Total Cases is: ' &amp;amp;&amp;nbsp;&amp;nbsp;firstsortedvalue([Counties.state],-Aggr(sum([Counties.cases]), [Counties.state])) &amp;amp; ' with a total of this many cases: ' &amp;amp; max(Aggr(sum([Counties.cases]), [Counties.state]))&lt;/P&gt;&lt;P&gt;But how can I go about setting up the same second worst state and case count? I know I can use rank in firstsortedvalue which results in New Jersey but how can I pass New Jersey dynamically into the set analysis that calculates the sum of cases?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Trying like this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;'Second Most Affected State by Total Cases is: ' &amp;amp;&lt;BR /&gt;firstsortedvalue([Counties.state],-Aggr(sum([Counties.cases]), [Counties.state]),2)&amp;amp; ' with a total of this many cases: ' &amp;amp; sum({&amp;lt;[Counties.state] = {"=$(firstsortedvalue([Counties.state],-Aggr(sum([Counties.cases]), [Counties.state]),2))"}&amp;gt;}[Counties.cases])&lt;/P&gt;&lt;P&gt;Do I need to use rank in the set analysis for cases?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 26 May 2020 22:02:58 GMT</pubDate>
    <dc:creator>ManuelLindekeit</dc:creator>
    <dc:date>2020-05-26T22:02:58Z</dc:date>
    <item>
      <title>Firstsortedvalue</title>
      <link>https://community.qlik.com/t5/App-Development/Firstsortedvalue/m-p/1705393#M54079</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;How would you approach this scenario? I'm working with Covid19 data and currently I would like to use firstsortedvalue to print the second worst affected US state by cases and its case number.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm getting the worst affected state and its correct case count done with this. Note that data is a few weeks old.&amp;nbsp;&lt;/P&gt;&lt;P&gt;'Most Affected State by Total Cases is: ' &amp;amp;&amp;nbsp;&amp;nbsp;firstsortedvalue([Counties.state],-Aggr(sum([Counties.cases]), [Counties.state])) &amp;amp; ' with a total of this many cases: ' &amp;amp; max(Aggr(sum([Counties.cases]), [Counties.state]))&lt;/P&gt;&lt;P&gt;But how can I go about setting up the same second worst state and case count? I know I can use rank in firstsortedvalue which results in New Jersey but how can I pass New Jersey dynamically into the set analysis that calculates the sum of cases?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Trying like this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;'Second Most Affected State by Total Cases is: ' &amp;amp;&lt;BR /&gt;firstsortedvalue([Counties.state],-Aggr(sum([Counties.cases]), [Counties.state]),2)&amp;amp; ' with a total of this many cases: ' &amp;amp; sum({&amp;lt;[Counties.state] = {"=$(firstsortedvalue([Counties.state],-Aggr(sum([Counties.cases]), [Counties.state]),2))"}&amp;gt;}[Counties.cases])&lt;/P&gt;&lt;P&gt;Do I need to use rank in the set analysis for cases?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 May 2020 22:02:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Firstsortedvalue/m-p/1705393#M54079</guid>
      <dc:creator>ManuelLindekeit</dc:creator>
      <dc:date>2020-05-26T22:02:58Z</dc:date>
    </item>
    <item>
      <title>Re: Firstsortedvalue</title>
      <link>https://community.qlik.com/t5/App-Development/Firstsortedvalue/m-p/1705625#M54099</link>
      <description>&lt;P&gt;May be this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;'Most Affected State by Total Cases is: ' &amp;amp;  FirstSortedValue([Counties.state], -Aggr(Sum([Counties.cases]), [Counties.state]), 2) &amp;amp; ' with a total of this many cases: ' &amp;amp; Max(Aggr(Sum([Counties.cases]), [Counties.state]), 2)&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 27 May 2020 12:37:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Firstsortedvalue/m-p/1705625#M54099</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2020-05-27T12:37:59Z</dc:date>
    </item>
  </channel>
</rss>

