<?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: Re: rank in pivot table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/rank-in-pivot-table/m-p/548135#M480204</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok... Check the example attached.&amp;nbsp; Note that I use different name for the column but at the end is similar.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 09 Dec 2013 14:30:32 GMT</pubDate>
    <dc:creator>jolivares</dc:creator>
    <dc:date>2013-12-09T14:30:32Z</dc:date>
    <item>
      <title>rank in pivot table</title>
      <link>https://community.qlik.com/t5/QlikView/rank-in-pivot-table/m-p/548132#M480201</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to create a pivot table, showing the sales per country, customer id and customer name.&lt;/P&gt;&lt;P&gt;In addition to the sales column, I want to have a column to show the rank of the individual sales.&lt;/P&gt;&lt;P&gt;The outcome should look like following at the end:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid #000000; width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Country&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Customer ID&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Customer Name&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Sales&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Rank&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;France&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Customer ID1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Customer 1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;100&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;France&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Customer ID2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Customer 2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;50&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;France&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Customer ID3&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Customer 3&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;200&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Germany&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Customer ID4&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Customer 4&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;400&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Germany&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Customer ID5&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Customer 5&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;100&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Country, Customer ID and Customer Name are dimensions, Sales and Rank are expressions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using an expression with the Rank function, which looks like following :HRank(SUM(Sales)).&lt;/P&gt;&lt;P&gt;However, it returns the rank for each individual line. So at the end, it shows for each line rank "1" as (for some reason), it is not comparing the sales of that single combination Country+CustomerID+Customername vs the total country sales.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried several different syntax but none of them worked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone have an idea, what needs to be changed here?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Dec 2013 12:59:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/rank-in-pivot-table/m-p/548132#M480201</guid>
      <dc:creator />
      <dc:date>2013-12-09T12:59:45Z</dc:date>
    </item>
    <item>
      <title>Re: rank in pivot table</title>
      <link>https://community.qlik.com/t5/QlikView/rank-in-pivot-table/m-p/548133#M480202</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;as I see in your example QV is ranking your data by Country, but you want that your rank is overall the sales value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this expression:&amp;nbsp; Rank(Total Sum(Sales)).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Int this case the TOTAL don't take care of what dimensions you have selected.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Dec 2013 13:25:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/rank-in-pivot-table/m-p/548133#M480202</guid>
      <dc:creator>jolivares</dc:creator>
      <dc:date>2013-12-09T13:25:34Z</dc:date>
    </item>
    <item>
      <title>Re: rank in pivot table</title>
      <link>https://community.qlik.com/t5/QlikView/rank-in-pivot-table/m-p/548134#M480203</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Juan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you misunderstood this.&lt;/P&gt;&lt;P&gt;The table above shows the required outcome. &lt;/P&gt;&lt;P&gt;But at the moment, the ranking function returns "1" for every line. It is basically ranking the data by each customer, not by country.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I already tried the expression by using the Total modifier, but still no change.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Dec 2013 14:22:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/rank-in-pivot-table/m-p/548134#M480203</guid>
      <dc:creator />
      <dc:date>2013-12-09T14:22:12Z</dc:date>
    </item>
    <item>
      <title>Re: Re: rank in pivot table</title>
      <link>https://community.qlik.com/t5/QlikView/rank-in-pivot-table/m-p/548135#M480204</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok... Check the example attached.&amp;nbsp; Note that I use different name for the column but at the end is similar.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Dec 2013 14:30:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/rank-in-pivot-table/m-p/548135#M480204</guid>
      <dc:creator>jolivares</dc:creator>
      <dc:date>2013-12-09T14:30:32Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Re: rank in pivot table</title>
      <link>https://community.qlik.com/t5/QlikView/rank-in-pivot-table/m-p/548136#M480205</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check again...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Dec 2013 15:20:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/rank-in-pivot-table/m-p/548136#M480205</guid>
      <dc:creator>jolivares</dc:creator>
      <dc:date>2013-12-09T15:20:55Z</dc:date>
    </item>
    <item>
      <title>Re: rank in pivot table</title>
      <link>https://community.qlik.com/t5/QlikView/rank-in-pivot-table/m-p/548137#M480206</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For the rank function, it depends on what dimensions you have. Look at this text from Qlikview Help on the rank function:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"If the chart is one-dimensional or if the &lt;SPAN style="font-style: italic;"&gt;expression&lt;/SPAN&gt; is preceded by the &lt;SPAN class="Bold"&gt;total&lt;/SPAN&gt; qualifier, the current column segment is always equal to the entire column. If the table or table equivalent has multiple vertical dimensions, the current column segment will include only rows with the same values as the current row in all dimension columns except for the column showing the last dimension in the inter field sort order."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your example, it is using the first two dimensions. This way every record is grouped with itself, so they all get a rank of 1. Remove Customer Name as dimension and put as expression, and if Sales is a dimension, change it to be sum(Sales). Hopefully this will resolve your issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Dec 2013 15:50:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/rank-in-pivot-table/m-p/548137#M480206</guid>
      <dc:creator>jerem1234</dc:creator>
      <dc:date>2013-12-09T15:50:07Z</dc:date>
    </item>
    <item>
      <title>Re: rank in pivot table</title>
      <link>https://community.qlik.com/t5/QlikView/rank-in-pivot-table/m-p/548138#M480207</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ross,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Coudl you try this:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;rank&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;aggr&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(Sale&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;s&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;), &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Country&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, CustomerID&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;AGGR creates a "table" dimensionned by Country and CustomerID. The rank returns the numer according to the rank it gets.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Fabrice&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Dec 2013 15:57:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/rank-in-pivot-table/m-p/548138#M480207</guid>
      <dc:creator />
      <dc:date>2013-12-09T15:57:11Z</dc:date>
    </item>
    <item>
      <title>Re: Re: rank in pivot table</title>
      <link>https://community.qlik.com/t5/QlikView/rank-in-pivot-table/m-p/548139#M480208</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi jerem1234 and Fabrice,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;jerem, you are correct. The rank function basically returns the ranking for each individual customer. So every customer gets the rank 1. Your hint with removing one column from the dimensions and adding it to the expression works indeed. I moved the customer ID column from the dimensions and added it to the expressions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, there is still an issue with that solution.&lt;/P&gt;&lt;P&gt;I added another dimension (month dimension), to show the sales+rankings per month. The column was added on the x-axis. &lt;/P&gt;&lt;P&gt;But it then repreats the column customer id for every month (see picture below):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="QV TEst.jpg" class="jive-image" height="101" src="/legacyfs/online/50242_QV TEst.jpg" style="width: 763.659px; height: 101px;" width="764" /&gt;&lt;/P&gt;&lt;P&gt;Is there a way to create the ranking while using country, customer name, customer id and month as dimensions?&lt;/P&gt;&lt;P&gt;I tried several functions, including the one from Fabrice (using Aggr) but it doesnt work out yet (see in the attached file)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Dec 2013 11:52:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/rank-in-pivot-table/m-p/548139#M480208</guid>
      <dc:creator />
      <dc:date>2013-12-10T11:52:50Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Re: rank in pivot table</title>
      <link>https://community.qlik.com/t5/QlikView/rank-in-pivot-table/m-p/548140#M480209</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've done it in this way:&lt;/P&gt;&lt;P&gt;Instead of having Customer ID as an expression or dimension, I just used one dimension of Customer Name &amp;amp; Customer ID concatenated since there is a 1-1 mapping (I'm assuming). Then the rank function can be used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please find attached. Hope this works for you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Dec 2013 15:57:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/rank-in-pivot-table/m-p/548140#M480209</guid>
      <dc:creator>jerem1234</dc:creator>
      <dc:date>2013-12-10T15:57:30Z</dc:date>
    </item>
  </channel>
</rss>

