<?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: problem with rank accumulations and sorting in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/problem-with-rank-accumulations-and-sorting/m-p/1070428#M524107</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And Rank has the same issue. You may need Rank(TOTAL ....)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 08 Feb 2016 12:38:30 GMT</pubDate>
    <dc:creator>jonathandienst</dc:creator>
    <dc:date>2016-02-08T12:38:30Z</dc:date>
    <item>
      <title>problem with rank accumulations and sorting</title>
      <link>https://community.qlik.com/t5/QlikView/problem-with-rank-accumulations-and-sorting/m-p/1070425#M524104</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;(i have this problem in my model but i was able to reproduce it with the generic NORTHWIND database&lt;/P&gt;&lt;P&gt;i'v attached both a demo QVW and the Northwind database in an xls file)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have a striehgt table with 3 dimensions&lt;/P&gt;&lt;P&gt;Category, Country, Company&lt;/P&gt;&lt;P&gt;i have 3 expressions&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff;"&gt;Count(DISTINCT OrderID)&lt;/SPAN&gt; &lt;SPAN style="color: #99cc00;"&gt;// counts the number of orders&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff;"&gt;num(rank(Count(DISTINCT OrderID) ,4))&lt;/SPAN&gt; &lt;SPAN style="color: #99cc00;"&gt;// ranks the above expression&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff;"&gt;Count(DISTINCT OrderID) / Count( TOTAL &amp;lt;CategoryName,Country&amp;gt;&amp;nbsp; DISTINCT OrderID)&lt;/SPAN&gt; &lt;SPAN style="color: #99cc00;"&gt;// gives the % for each company from the total for each &lt;/SPAN&gt;&lt;SPAN style="color: #99cc00; font-size: 13.3333px;"&gt;Category and Country&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now i want to accumulate the 3rd experssion so for each &lt;SPAN style="font-size: 13.3333px;"&gt;Category and Country it will start again&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;so i took the 3 expression and used rangesum and above functions + the rowno function like this&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;(taken from HIC blog post about accumulations)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;the expression looks like that&lt;/SPAN&gt;:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff;"&gt;RangeSum(Above(&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff;"&gt;Count(DISTINCT OrderID) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff;"&gt;/&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff;"&gt;Count( TOTAL &amp;lt;CategoryName,Country&amp;gt;&amp;nbsp; DISTINCT OrderID) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff;"&gt;,0,RowNo()))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;i want the sort order to be&lt;/P&gt;&lt;P&gt;Category (text sort) and then&lt;/P&gt;&lt;P&gt;Country (text sort)&lt;/P&gt;&lt;P&gt;and for each country the Company should be sorted by the rank in asc order (or the 1st expr desc)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so i will get the correct accumulation&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but no matter what i try the sort order does not get right&lt;/P&gt;&lt;P&gt;(the accumulation works but since the sort order is wrong its of no use &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;any ideas why?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="113887" alt="table.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/113887_table.png" style="height: 227px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Feb 2016 12:26:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problem-with-rank-accumulations-and-sorting/m-p/1070425#M524104</guid>
      <dc:creator>wizardo</dc:creator>
      <dc:date>2016-02-08T12:26:39Z</dc:date>
    </item>
    <item>
      <title>Re: problem with rank accumulations and sorting</title>
      <link>https://community.qlik.com/t5/QlikView/problem-with-rank-accumulations-and-sorting/m-p/1070426#M524105</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Because the Above function is Sort dependent, as soon as you change the sorting, the number will change. The way around this is to sort the data correctly in the script and use Aggr() function because Aggr() uses sort order and not the order specified in the chart.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Feb 2016 12:31:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problem-with-rank-accumulations-and-sorting/m-p/1070426#M524105</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-02-08T12:31:09Z</dc:date>
    </item>
    <item>
      <title>Re: problem with rank accumulations and sorting</title>
      <link>https://community.qlik.com/t5/QlikView/problem-with-rank-accumulations-and-sorting/m-p/1070427#M524106</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;With multiple dimensions, you may need a TOTAL inside the Above as well, otherwise it is referring to the first dimension only&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RangeSum(Above(&lt;STRONG&gt;TOTAL&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Count(DISTINCT OrderID)&lt;/P&gt;&lt;P&gt;/&lt;/P&gt;&lt;P&gt;Count( TOTAL &amp;lt;CategoryName,Country&amp;gt;&amp;nbsp; DISTINCT OrderID)&lt;/P&gt;&lt;P&gt;,0,RowNo()))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Feb 2016 12:37:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problem-with-rank-accumulations-and-sorting/m-p/1070427#M524106</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2016-02-08T12:37:01Z</dc:date>
    </item>
    <item>
      <title>Re: problem with rank accumulations and sorting</title>
      <link>https://community.qlik.com/t5/QlikView/problem-with-rank-accumulations-and-sorting/m-p/1070428#M524107</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And Rank has the same issue. You may need Rank(TOTAL ....)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Feb 2016 12:38:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problem-with-rank-accumulations-and-sorting/m-p/1070428#M524107</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2016-02-08T12:38:30Z</dc:date>
    </item>
    <item>
      <title>Re: problem with rank accumulations and sorting</title>
      <link>https://community.qlik.com/t5/QlikView/problem-with-rank-accumulations-and-sorting/m-p/1070429#M524108</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;SPAN class="j-post-author" style="font-size: 0.9em; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-size: 11.7px; font-family: inherit;"&gt;&lt;A href="https://community.qlik.com/people/jontydkpi"&gt;jontydkpi&lt;/A&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="j-post-author" style="font-size: 0.9em; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-size: 11.7px; font-family: inherit;"&gt;Thanks for replying.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="j-post-author" style="font-size: 0.9em; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-size: 11.7px; font-family: inherit;"&gt;as i said in my post the accumulation works.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="j-post-author" style="font-size: 0.9em; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-size: 11.7px; font-family: inherit;"&gt;but since the chart is not sorted the way i want it acculunlate the wrong things and thats my problem&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="j-post-author" style="font-size: 0.9em; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-size: 11.7px; font-family: inherit;"&gt;why is the sort order not working&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Feb 2016 13:37:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problem-with-rank-accumulations-and-sorting/m-p/1070429#M524108</guid>
      <dc:creator>wizardo</dc:creator>
      <dc:date>2016-02-08T13:37:57Z</dc:date>
    </item>
    <item>
      <title>Re: problem with rank accumulations and sorting</title>
      <link>https://community.qlik.com/t5/QlikView/problem-with-rank-accumulations-and-sorting/m-p/1070430#M524109</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;the accumulations works and accumulates the number correctly and starts again on every combination of category and country just as i need. if i will put the TOTAL it will accumulate everything and wont restart for each &lt;SPAN style="font-size: 13.3333px;"&gt;combination of category and country.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;like i said&lt;/P&gt;&lt;P&gt;my problem is that the sort is not working whice leads to the accumulation working but not in the order i need&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Feb 2016 13:40:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problem-with-rank-accumulations-and-sorting/m-p/1070430#M524109</guid>
      <dc:creator>wizardo</dc:creator>
      <dc:date>2016-02-08T13:40:40Z</dc:date>
    </item>
  </channel>
</rss>

