<?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: Sorted Aggr function in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Sorted-Aggr-function/m-p/1522171#M37443</link>
    <description>&lt;P&gt;Thanks but the latest formula doesn't work&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/2350iA6958E2C80F0D928/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 18 Dec 2018 13:17:00 GMT</pubDate>
    <dc:creator>maxsheva</dc:creator>
    <dc:date>2018-12-18T13:17:00Z</dc:date>
    <item>
      <title>Sorted Aggr function</title>
      <link>https://community.qlik.com/t5/App-Development/Sorted-Aggr-function/m-p/1522082#M37431</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to get a sort order in Aggr function.&lt;/P&gt;&lt;P&gt;Please take a look at an example below.&lt;/P&gt;&lt;P&gt;This table is sorted by Sum(Sales).&amp;nbsp;I need to present all aggregated values per Region&amp;nbsp;as a first row per each distinct value from this first column.&lt;/P&gt;&lt;P&gt;I have already tried this &lt;STRONG&gt;Aggr(Sum(Sales),(Region,(=Sum({1}Sales),Desc)))&lt;/STRONG&gt; but no success.&lt;/P&gt;&lt;P&gt;Version of Qlik Sense Desktop is 12.36.1&lt;/P&gt;&lt;P&gt;Any help will be appreciated.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Untitled.jpg" style="width: 971px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/2336iB65C2D2D847B56A0/image-size/large?v=v2&amp;amp;px=999" role="button" title="Untitled.jpg" alt="Untitled.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Dec 2018 11:16:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sorted-Aggr-function/m-p/1522082#M37431</guid>
      <dc:creator>maxsheva</dc:creator>
      <dc:date>2018-12-18T11:16:45Z</dc:date>
    </item>
    <item>
      <title>Re: Sorted Aggr function</title>
      <link>https://community.qlik.com/t5/App-Development/Sorted-Aggr-function/m-p/1522105#M37432</link>
      <description>&lt;P&gt;Can you try modifying the sorting order for that object?&lt;/P&gt;</description>
      <pubDate>Tue, 18 Dec 2018 11:32:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sorted-Aggr-function/m-p/1522105#M37432</guid>
      <dc:creator>rangam_s</dc:creator>
      <dc:date>2018-12-18T11:32:21Z</dc:date>
    </item>
    <item>
      <title>Re: Sorted Aggr function</title>
      <link>https://community.qlik.com/t5/App-Development/Sorted-Aggr-function/m-p/1522110#M37434</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&amp;nbsp;thanks for suggestion.&lt;/P&gt;&lt;P&gt;Just tried again and found result very close to expected.&lt;/P&gt;&lt;P&gt;But still wondering whether is possible to present values for South with the same row as highest Sales in this Region (Florida)?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Untitled.jpg" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/2342i5774ADB662BF0788/image-size/large?v=v2&amp;amp;px=999" role="button" title="Untitled.jpg" alt="Untitled.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Dec 2018 11:42:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sorted-Aggr-function/m-p/1522110#M37434</guid>
      <dc:creator>maxsheva</dc:creator>
      <dc:date>2018-12-18T11:42:56Z</dc:date>
    </item>
    <item>
      <title>Re: Sorted Aggr function</title>
      <link>https://community.qlik.com/t5/App-Development/Sorted-Aggr-function/m-p/1522138#M37439</link>
      <description>&lt;P&gt;How about if you try this&lt;/P&gt;&lt;PRE&gt;If(Max(TOTAL &amp;lt;Region&amp;gt; Aggr(Sum(Sales), Region, State)) = Sum(Sales), Sum(TOTAL &amp;lt;Region&amp;gt; Sales))&lt;/PRE&gt;&lt;P&gt;or&lt;/P&gt;&lt;PRE&gt;If(Max(TOTAL &amp;lt;Region&amp;gt; Aggr(Sum(Sales), Region, State)) = Sum(Sales), Aggr(NODISTINCT Sum(Sales), Region))&lt;/PRE&gt;</description>
      <pubDate>Tue, 18 Dec 2018 12:31:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sorted-Aggr-function/m-p/1522138#M37439</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-12-18T12:31:04Z</dc:date>
    </item>
    <item>
      <title>Re: Sorted Aggr function</title>
      <link>https://community.qlik.com/t5/App-Development/Sorted-Aggr-function/m-p/1522152#M37441</link>
      <description>Thank you Sunny! As usual quick and accurate answer.&lt;BR /&gt;&lt;BR /&gt;I am wondering whether If statement will affect on performance if there 10 millions rows?</description>
      <pubDate>Tue, 18 Dec 2018 12:55:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sorted-Aggr-function/m-p/1522152#M37441</guid>
      <dc:creator>maxsheva</dc:creator>
      <dc:date>2018-12-18T12:55:40Z</dc:date>
    </item>
    <item>
      <title>Re: Sorted Aggr function</title>
      <link>https://community.qlik.com/t5/App-Development/Sorted-Aggr-function/m-p/1522154#M37442</link>
      <description>&lt;P&gt;It probably will have some impact... but can you give this a try&lt;/P&gt;&lt;PRE&gt;&lt;FONT color="#FF0000"&gt;Aggr(&lt;/FONT&gt;Aggr(Sum(Sales), &lt;FONT color="#FF0000"&gt;Region&lt;/FONT&gt;, (&lt;FONT color="#FF0000"&gt;State&lt;/FONT&gt;, (=Sum({1}Sales), Desc)))&lt;FONT color="#FF0000"&gt;, Region)&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Dec 2018 13:03:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sorted-Aggr-function/m-p/1522154#M37442</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-12-18T13:03:00Z</dc:date>
    </item>
    <item>
      <title>Re: Sorted Aggr function</title>
      <link>https://community.qlik.com/t5/App-Development/Sorted-Aggr-function/m-p/1522171#M37443</link>
      <description>&lt;P&gt;Thanks but the latest formula doesn't work&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/2350iA6958E2C80F0D928/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Dec 2018 13:17:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sorted-Aggr-function/m-p/1522171#M37443</guid>
      <dc:creator>maxsheva</dc:creator>
      <dc:date>2018-12-18T13:17:00Z</dc:date>
    </item>
    <item>
      <title>Re: Sorted Aggr function</title>
      <link>https://community.qlik.com/t5/App-Development/Sorted-Aggr-function/m-p/1522178#M37445</link>
      <description>&lt;P&gt;Yup, gave it a shot... I don't think sorting can help here... the only other option is to create a new field which combines Region and State into a single field and use it in a set analysis...&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;Only({&amp;lt;Region_State = {"=Aggr(Max(TOTAL &amp;lt;Region&amp;gt; Aggr(Sum(Sales), Region_State, Region)), Region_State, Region) = Sum(Sales)"}&amp;gt;} Aggr(NODISTINCT Sum(Sales), Region))&lt;/PRE&gt;&lt;P&gt;Here Region_State is created in the script like this&lt;/P&gt;&lt;PRE&gt;Table:
LOAD *,
	 &lt;FONT color="#FF0000"&gt;Region&amp;amp;'_'&amp;amp;State as Region_State;&lt;/FONT&gt;
LOAD * INLINE [
    Region, State, Sales
    South, Virginia, 7357994
    South, Florida, 7820644
    South, Georgia, 4127387
    West, Washington, 9651689
    West, California, 39974313
    West, Arizona, 3375967
];&lt;/PRE&gt;</description>
      <pubDate>Tue, 18 Dec 2018 13:34:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sorted-Aggr-function/m-p/1522178#M37445</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-12-18T13:34:00Z</dc:date>
    </item>
    <item>
      <title>Re: Sorted Aggr function</title>
      <link>https://community.qlik.com/t5/App-Development/Sorted-Aggr-function/m-p/1522185#M37447</link>
      <description>&lt;P&gt;Thanks a lot, Sunny!&lt;/P&gt;</description>
      <pubDate>Tue, 18 Dec 2018 13:41:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sorted-Aggr-function/m-p/1522185#M37447</guid>
      <dc:creator>maxsheva</dc:creator>
      <dc:date>2018-12-18T13:41:08Z</dc:date>
    </item>
  </channel>
</rss>

