<?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 Help! Nested Aggregation Sort in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Help-Nested-Aggregation-Sort/m-p/1305493#M406413</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have an aggregation like this:&lt;/P&gt;&lt;PRE __default_attr="html" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14964372007017348 jive_text_macro" jivemacro_uid="_14964372007017348" modifiedtitle="true"&gt;
&lt;P&gt;= concat( aggr(count(distinct ID_FIELD), TXT_FIELD),'|')&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And I need the concatenation result to be in alphabetic order, so I tried this:&lt;/P&gt;&lt;PRE __default_attr="html" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14964373465068704" jivemacro_uid="_14964373465068704" modifiedtitle="true"&gt;
&lt;P&gt;&lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;= concat( aggr(count(distinct ID_FIELD), (TXT_FIELD,(TEXT,A2Z))),'|')&lt;/SPAN&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also I have tried something like this:&lt;/P&gt;&lt;PRE __default_attr="html" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14964374203205229" jivemacro_uid="_14964374203205229" modifiedtitle="true"&gt;
&lt;P&gt;&lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;= concat( aggr(count(distinct ID_FIELD), TXT_FIELD),'|',TXT_FIELD)&lt;/SPAN&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And even this:&lt;/P&gt;&lt;PRE __default_attr="html" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14964375166046644 jive_text_macro" jivemacro_uid="_14964375166046644" modifiedtitle="true"&gt;
&lt;P&gt;&lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;= concat( aggr(count(distinct ID_FIELD), (TXT_FIELD,(TEXT,A2Z))),'|'&lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;,(TXT_FIELD,(TEXT,A2Z)&lt;/SPAN&gt;)&lt;/SPAN&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With no luck,can you please help me?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 02 Jun 2017 21:07:19 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-06-02T21:07:19Z</dc:date>
    <item>
      <title>Help! Nested Aggregation Sort</title>
      <link>https://community.qlik.com/t5/QlikView/Help-Nested-Aggregation-Sort/m-p/1305493#M406413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have an aggregation like this:&lt;/P&gt;&lt;PRE __default_attr="html" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14964372007017348 jive_text_macro" jivemacro_uid="_14964372007017348" modifiedtitle="true"&gt;
&lt;P&gt;= concat( aggr(count(distinct ID_FIELD), TXT_FIELD),'|')&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And I need the concatenation result to be in alphabetic order, so I tried this:&lt;/P&gt;&lt;PRE __default_attr="html" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14964373465068704" jivemacro_uid="_14964373465068704" modifiedtitle="true"&gt;
&lt;P&gt;&lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;= concat( aggr(count(distinct ID_FIELD), (TXT_FIELD,(TEXT,A2Z))),'|')&lt;/SPAN&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also I have tried something like this:&lt;/P&gt;&lt;PRE __default_attr="html" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14964374203205229" jivemacro_uid="_14964374203205229" modifiedtitle="true"&gt;
&lt;P&gt;&lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;= concat( aggr(count(distinct ID_FIELD), TXT_FIELD),'|',TXT_FIELD)&lt;/SPAN&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And even this:&lt;/P&gt;&lt;PRE __default_attr="html" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14964375166046644 jive_text_macro" jivemacro_uid="_14964375166046644" modifiedtitle="true"&gt;
&lt;P&gt;&lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;= concat( aggr(count(distinct ID_FIELD), (TXT_FIELD,(TEXT,A2Z))),'|'&lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;,(TXT_FIELD,(TEXT,A2Z)&lt;/SPAN&gt;)&lt;/SPAN&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With no luck,can you please help me?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Jun 2017 21:07:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-Nested-Aggregation-Sort/m-p/1305493#M406413</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-06-02T21:07:19Z</dc:date>
    </item>
    <item>
      <title>Re: Help! Nested Aggregation Sort</title>
      <link>https://community.qlik.com/t5/QlikView/Help-Nested-Aggregation-Sort/m-p/1305494#M406414</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Bruno,&lt;/P&gt;&lt;P&gt;I think your data would be something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ID_FIELD|TXT_FIELD&lt;/P&gt;&lt;P&gt;11|abc&lt;/P&gt;&lt;P&gt;12|def&lt;/P&gt;&lt;P&gt;12|def&lt;/P&gt;&lt;P&gt;13|ghi&lt;/P&gt;&lt;P&gt;14|jkl&lt;/P&gt;&lt;P&gt;15|mno&lt;/P&gt;&lt;P&gt;15|mno&lt;/P&gt;&lt;P&gt;15|mno&lt;/P&gt;&lt;P&gt;14|jkl&lt;/P&gt;&lt;P&gt;13|ghi&lt;/P&gt;&lt;P&gt;13|ghi&lt;/P&gt;&lt;P&gt;14|jkl&lt;/P&gt;&lt;P&gt;14|jkl&lt;/P&gt;&lt;P&gt;15|mno&lt;/P&gt;&lt;P&gt;15|mno&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and I guess you would want ouput as:&lt;/P&gt;&lt;P&gt;ID_COUNT|TXT_FIELD&lt;/P&gt;&lt;P&gt;5|mno&lt;/P&gt;&lt;P&gt;4|jkl&lt;/P&gt;&lt;P&gt;3|ghi&lt;/P&gt;&lt;P&gt;2|def&lt;/P&gt;&lt;P&gt;1|abc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to have 2 expressions in your chart object:&lt;/P&gt;&lt;P&gt;1. For ID_COUNT&lt;/P&gt;&lt;P&gt;=MAX(AGGR(COUNT(ID_FIELD),TXT_FIELD)))&lt;/P&gt;&lt;P&gt;Sort this expression field in descending order by value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. For TXT_FIELD&lt;/P&gt;&lt;P&gt;=FIRSTSORTEDVALUE([TXT_FIELD],-AGGR(COUNT(ID_FIELD),TXT_FIELD)))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know if this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Jun 2017 17:27:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-Nested-Aggregation-Sort/m-p/1305494#M406414</guid>
      <dc:creator />
      <dc:date>2017-06-03T17:27:28Z</dc:date>
    </item>
    <item>
      <title>Re: Help! Nested Aggregation Sort</title>
      <link>https://community.qlik.com/t5/QlikView/Help-Nested-Aggregation-Sort/m-p/1305495#M406415</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Search for threads like Sortable AGGR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-blogpost/4673"&gt;The sortable Aggr function is finally here!&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Jun 2017 20:42:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-Nested-Aggregation-Sort/m-p/1305495#M406415</guid>
      <dc:creator>vinieme12</dc:creator>
      <dc:date>2017-06-03T20:42:31Z</dc:date>
    </item>
    <item>
      <title>Re: Help! Nested Aggregation Sort</title>
      <link>https://community.qlik.com/t5/QlikView/Help-Nested-Aggregation-Sort/m-p/1305496#M406416</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your answer, but I still can't find where my mistake is!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 04 Jun 2017 20:33:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-Nested-Aggregation-Sort/m-p/1305496#M406416</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-06-04T20:33:15Z</dc:date>
    </item>
    <item>
      <title>Re: Help! Nested Aggregation Sort</title>
      <link>https://community.qlik.com/t5/QlikView/Help-Nested-Aggregation-Sort/m-p/1305497#M406417</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your answer, but I really need it to be in a single expression!&lt;/P&gt;&lt;P&gt;Also I don't have any dimensions in this chart, I'm using it do create an URL to download an image from Google Chart!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I ended up doing was:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;=keepchar(concat( aggr(TXT_FIELD&amp;amp;'-'&amp;amp;count(distinct ID_FIELD), TXT_FIELD),'|'),'0123456789')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Ugly, I agree.. but works!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;But I still don't understand why this won't work:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;= concat( aggr(count(distinct ID_FIELD), (TXT_FIELD,(TEXT,A2Z))),'|')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 04 Jun 2017 20:38:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-Nested-Aggregation-Sort/m-p/1305497#M406417</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-06-04T20:38:13Z</dc:date>
    </item>
    <item>
      <title>Re: Help! Nested Aggregation Sort</title>
      <link>https://community.qlik.com/t5/QlikView/Help-Nested-Aggregation-Sort/m-p/1305498#M406418</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The Concat() function applies its own sort to the elements to be concatenated, that's why you can set a sort weight as third argument. If you don't set a sort weight, the elements will be sorted in alphabetical order, that's why your work around works like expected.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 04 Jun 2017 21:45:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-Nested-Aggregation-Sort/m-p/1305498#M406418</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2017-06-04T21:45:22Z</dc:date>
    </item>
  </channel>
</rss>

