<?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: Aggr for 2x dimensions - sorting by expresion problem (Pareto analysis) in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Aggr-for-2x-dimensions-sorting-by-expresion-problem-Pareto/m-p/1556624#M40422</link>
    <description>I would really like an opinion about the above. App performance is at unacceptable level when using my workaround. Really noone studied sorting by expression inside Aggr() ??</description>
    <pubDate>Thu, 14 Mar 2019 15:10:41 GMT</pubDate>
    <dc:creator>BeeGees</dc:creator>
    <dc:date>2019-03-14T15:10:41Z</dc:date>
    <item>
      <title>Aggr for 2x dimensions - sorting by expresion problem (Pareto analysis)</title>
      <link>https://community.qlik.com/t5/App-Development/Aggr-for-2x-dimensions-sorting-by-expresion-problem-Pareto/m-p/1552825#M39839</link>
      <description>&lt;P&gt;Hi, I want to calculate running total % of sales for pareto analysis. Everything works fine when working with one dimension. Lets say i have dimension "Key" and wanna to sort it by "sum(Sales)" in descending order using Aggr. So i do:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Aggr(
rangesum(Above(sum([Sales])/sum(TOTAL [Sales]), 0, rowno() )),
(Key, (=Sum([Sales]), DESC))
)&lt;/PRE&gt;&lt;P&gt;That just works. But when i want to put into a play second dimension (lets say month) things is starting to get messy. First i went with this set analysis:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;=Aggr(
rangesum(Above(sum([Sales])/sum(TOTAL &amp;lt;Month&amp;gt; [Sales]), 0, rowno() )),
Month, (Key, (=Sum([Sales]), DESC))
)&lt;/PRE&gt;&lt;P&gt;The problem with the above is that Aggr sorts rows within Aggr by Key, but GLOBALLY not by each month SEPARETLY. Which leads to incorrect results. &lt;STRONG&gt;Is there any way to sort data within Aggr by Key &amp;amp; Month?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I came up with an ugly solution, thats is not flexible in any means (requires loading script changes). I just loaded every possible combination of Key &amp;amp; Month into my model and created new dimension KeyMonthCombined. Then expression looks like:&lt;/P&gt;&lt;PRE&gt;=Aggr(
rangesum(Above(sum([Sales])/sum(TOTAL &amp;lt;Month&amp;gt; [Sales]), 0, rowno() )),
Month, (KeyMonthCombined, (=Sum([Sales]), DESC))
)&lt;/PRE&gt;&lt;P&gt;And it works. But i feel like I'm putting too much effort into this and it could be done in much more easy way.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 06 Mar 2019 09:50:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Aggr-for-2x-dimensions-sorting-by-expresion-problem-Pareto/m-p/1552825#M39839</guid>
      <dc:creator>BeeGees</dc:creator>
      <dc:date>2019-03-06T09:50:24Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr for 2x dimensions - sorting by expresion problem (Pareto analysis)</title>
      <link>https://community.qlik.com/t5/App-Development/Aggr-for-2x-dimensions-sorting-by-expresion-problem-Pareto/m-p/1554264#M39917</link>
      <description>&lt;P&gt;Anyone?&lt;/P&gt;</description>
      <pubDate>Fri, 08 Mar 2019 13:50:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Aggr-for-2x-dimensions-sorting-by-expresion-problem-Pareto/m-p/1554264#M39917</guid>
      <dc:creator>BeeGees</dc:creator>
      <dc:date>2019-03-08T13:50:09Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr for 2x dimensions - sorting by expresion problem (Pareto analysis)</title>
      <link>https://community.qlik.com/t5/App-Development/Aggr-for-2x-dimensions-sorting-by-expresion-problem-Pareto/m-p/1556624#M40422</link>
      <description>I would really like an opinion about the above. App performance is at unacceptable level when using my workaround. Really noone studied sorting by expression inside Aggr() ??</description>
      <pubDate>Thu, 14 Mar 2019 15:10:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Aggr-for-2x-dimensions-sorting-by-expresion-problem-Pareto/m-p/1556624#M40422</guid>
      <dc:creator>BeeGees</dc:creator>
      <dc:date>2019-03-14T15:10:41Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr for 2x dimensions - sorting by expresion problem (Pareto analysis)</title>
      <link>https://community.qlik.com/t5/App-Development/Aggr-for-2x-dimensions-sorting-by-expresion-problem-Pareto/m-p/1894374#M73779</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/13006"&gt;@BeeGees&lt;/a&gt;, I'm facing the exact same problem. Have you been able to find a solution?&lt;/P&gt;</description>
      <pubDate>Thu, 17 Feb 2022 15:05:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Aggr-for-2x-dimensions-sorting-by-expresion-problem-Pareto/m-p/1894374#M73779</guid>
      <dc:creator>pennetzdorfer</dc:creator>
      <dc:date>2022-02-17T15:05:29Z</dc:date>
    </item>
  </channel>
</rss>

