<?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: Rank function in an expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Rank-function-in-an-expression/m-p/272093#M101920</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Romi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried setting the three also but didn’t work for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you send me your example and I will cross reference?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gregg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Feb 2012 15:16:39 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-02-10T15:16:39Z</dc:date>
    <item>
      <title>Rank function in an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-function-in-an-expression/m-p/272086#M101913</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;I have&amp;nbsp; created a pivot chart using 3 dimensions with several different rates calculated as expressions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;The issue I am having is that I need to sort the pivot by one of the expressions e.g. (AR)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;I cannot sort the pivot in the usual manner (using the sort tab) as this only affects the dimensions and not the expressions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;Is there a possibility to add a sort to my expressions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;They are simple expressions (e.g.)&amp;nbsp; sum(Activity) / sum (time)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial; min-height: 8pt; height: 8pt;"&gt;The only way possible I can see to acheive this is by using maybe a rank function and rank the results in ascending order.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial; min-height: 8pt; height: 8pt;"&gt;Do you know if this possible and if so, how?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial; min-height: 8pt; height: 8pt;"&gt;I am not overly familiar with expressions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;Regards,&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;Gregg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Feb 2012 14:35:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-function-in-an-expression/m-p/272086#M101913</guid>
      <dc:creator />
      <dc:date>2012-02-10T14:35:47Z</dc:date>
    </item>
    <item>
      <title>Rank function in an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-function-in-an-expression/m-p/272087#M101914</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I posted the answer in you previous post look at in your previous post.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Rank(Aggr(sum(Activity) / sum (time),Year,Quarter,Month)) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Celambarasan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Feb 2012 14:44:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-function-in-an-expression/m-p/272087#M101914</guid>
      <dc:creator>CELAMBARASAN</dc:creator>
      <dc:date>2012-02-10T14:44:04Z</dc:date>
    </item>
    <item>
      <title>Re: Rank function in an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-function-in-an-expression/m-p/272088#M101915</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Greg, &lt;/P&gt;&lt;P&gt;You can achieve this by changing the Sort By option for your first dimension in the list. Select the option to sort it by Expression and then copy and paste the expression formula e.g.(formula for the AR expression).&lt;/P&gt;&lt;P&gt;This will sort the entire pivot table based on the result of that formula. Make sure you clear the other options to sort by. See an example in the attached picture.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Romi&lt;/P&gt;&lt;P&gt;﻿&lt;/P&gt;&lt;P&gt;&lt;IMG alt="sort by.jpg" class="jive-image-thumbnail jive-image" onclick="" src="https://community.qlik.com/legacyfs/online/11164_sort+by.jpg" width="450" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Feb 2012 14:45:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-function-in-an-expression/m-p/272088#M101915</guid>
      <dc:creator />
      <dc:date>2012-02-10T14:45:31Z</dc:date>
    </item>
    <item>
      <title>Rank function in an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-function-in-an-expression/m-p/272089#M101916</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Romi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried this but it doesn't work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Gregg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Feb 2012 15:01:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-function-in-an-expression/m-p/272089#M101916</guid>
      <dc:creator />
      <dc:date>2012-02-10T15:01:50Z</dc:date>
    </item>
    <item>
      <title>Rank function in an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-function-in-an-expression/m-p/272090#M101917</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you post some screen shot of your table and one with the sort tab? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Romi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Feb 2012 15:07:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-function-in-an-expression/m-p/272090#M101917</guid>
      <dc:creator />
      <dc:date>2012-02-10T15:07:01Z</dc:date>
    </item>
    <item>
      <title>Rank function in an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-function-in-an-expression/m-p/272091#M101918</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Gregg, &lt;/P&gt;&lt;P&gt;If you want every single dimension on that pivot table to be sorted by that expresion, you will have to repeat this step for all 3 dimensions. I can send you an example if you want as it works fine for me. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Romi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Feb 2012 15:14:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-function-in-an-expression/m-p/272091#M101918</guid>
      <dc:creator />
      <dc:date>2012-02-10T15:14:47Z</dc:date>
    </item>
    <item>
      <title>Rank function in an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-function-in-an-expression/m-p/272092#M101919</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;IMG alt="expression.png" class="jive-image-thumbnail jive-image" onclick="" src="https://community.qlik.com/legacyfs/online/11168_expression.png" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi Romi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I cannot post the information but basically I have dimension on the left that I pivot off:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;customer&lt;/P&gt;&lt;P&gt;name &lt;/P&gt;&lt;P&gt;Code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then on the right I have my expressions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I set the sort by expression on the customer field but did not work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Gregg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Feb 2012 15:14:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-function-in-an-expression/m-p/272092#M101919</guid>
      <dc:creator />
      <dc:date>2012-02-10T15:14:47Z</dc:date>
    </item>
    <item>
      <title>Re: Rank function in an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-function-in-an-expression/m-p/272093#M101920</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Romi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried setting the three also but didn’t work for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you send me your example and I will cross reference?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gregg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Feb 2012 15:16:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-function-in-an-expression/m-p/272093#M101920</guid>
      <dc:creator />
      <dc:date>2012-02-10T15:16:39Z</dc:date>
    </item>
    <item>
      <title>Rank function in an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-function-in-an-expression/m-p/272094#M101921</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do the exact same sorting for the other 2 dimensions (name and tmscode) and then it should work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Romi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Feb 2012 15:17:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-function-in-an-expression/m-p/272094#M101921</guid>
      <dc:creator />
      <dc:date>2012-02-10T15:17:03Z</dc:date>
    </item>
    <item>
      <title>Rank function in an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-function-in-an-expression/m-p/272095#M101922</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here are some screenshots. If you want the actual file, I can email it to you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Romi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;------------------&lt;/P&gt;&lt;P&gt;Screenshot with the Pivot table. Data is from a Qv example. Notice that all the data is sorted by the value of the Total Price field.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Table.jpg" class="jive-image-thumbnail jive-image" onclick="" src="https://community.qlik.com/legacyfs/online/11171_Table.jpg" width="450" /&gt;&lt;/P&gt;&lt;P&gt;This is the formula for the Total Price fields&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Expression.jpg" class="jive-image-thumbnail jive-image" onclick="" src="https://community.qlik.com/legacyfs/online/11172_Expression.jpg" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the Sort by option for the first dimension.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Sort1.jpg" class="jive-image-thumbnail jive-image" onclick="" src="https://community.qlik.com/legacyfs/online/11173_Sort1.jpg" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the Sort by option for the second dimension.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Sort2.jpg" class="jive-image-thumbnail jive-image" onclick="" src="https://community.qlik.com/legacyfs/online/11174_Sort2.jpg" width="450" /&gt;&lt;/P&gt;&lt;P&gt;This is the Sort by option for the third dimension.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Sort3.jpg" class="jive-image-thumbnail jive-image" onclick="" src="https://community.qlik.com/legacyfs/online/11175_Sort3.jpg" width="450" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Feb 2012 15:31:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-function-in-an-expression/m-p/272095#M101922</guid>
      <dc:creator />
      <dc:date>2012-02-10T15:31:17Z</dc:date>
    </item>
    <item>
      <title>Re: Rank function in an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-function-in-an-expression/m-p/272096#M101923</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Romi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It’s a strange one as I have tried exactluy what you gave me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried the following expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rank(Aggr(Sum(Cases2) / sum(HOURS /60),customer)) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I put this into the 3 expression fields and it works for 95 % of the data but for some reason in one of the customer fields data, it is not sorting!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cant seem to catch a break on this one!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Feb 2012 16:22:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-function-in-an-expression/m-p/272096#M101923</guid>
      <dc:creator />
      <dc:date>2012-02-10T16:22:07Z</dc:date>
    </item>
    <item>
      <title>Re: Rank function in an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-function-in-an-expression/m-p/272097#M101924</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" href="https://community.qlik.com/people/celambarasan" id="jive-7002917323033392573837" style="background-color: #f9f9f9; font-size: 12px; color: #007fc0; font-weight: bold; font-family: Arial; text-align: center;"&gt;Celambarasan Adhimulam&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried your expression &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rank(Aggr(Sum(Cases2) / sum(HOURS /60),customer))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It sorts for all of the customers excepts one - not sure why!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Feb 2012 16:23:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-function-in-an-expression/m-p/272097#M101924</guid>
      <dc:creator />
      <dc:date>2012-02-10T16:23:04Z</dc:date>
    </item>
    <item>
      <title>Rank function in an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-function-in-an-expression/m-p/272098#M101925</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Greg, &lt;/P&gt;&lt;P&gt;If I were you, I would create a straight table chart&amp;nbsp; with these 3 dimensions and the expresion formula and inspect the data to make sure it produces the right result. It will be easier to troubleshoot that way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Romi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Feb 2012 16:52:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-function-in-an-expression/m-p/272098#M101925</guid>
      <dc:creator />
      <dc:date>2012-02-10T16:52:05Z</dc:date>
    </item>
    <item>
      <title>Rank function in an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-function-in-an-expression/m-p/272099#M101926</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Use expression for all dimensions as below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; For customer:Rank(Aggr(Sum(Cases2) / sum(HOURS /60),customer))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; For name : Rank(Aggr(Sum(Cases2) / sum(HOURS /60),name,Customer))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; For Code : Rank(Aggr(Sum(Cases2) / sum(HOURS /60),code,name,customer))&lt;/P&gt;&lt;P&gt;I believe it will help you&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Celambarasan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Feb 2012 06:38:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-function-in-an-expression/m-p/272099#M101926</guid>
      <dc:creator>CELAMBARASAN</dc:creator>
      <dc:date>2012-02-11T06:38:18Z</dc:date>
    </item>
    <item>
      <title>Re: Rank function in an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-function-in-an-expression/m-p/272100#M101927</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Celambarasan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried using your format below but that doesn’t work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I use the original way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     For customer:Rank(Aggr(Sum(Cases2) / sum(HOURS /60),customer))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     For name : Rank(Aggr(Sum(Cases2) / sum(HOURS /60),name))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     For Code : Rank(Aggr(Sum(Cases2) / sum(HOURS /60),code))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get it sorted but the last problem I have is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems to format everything ok except for when a user is listed twice. For example if user1 has a rate for customer1, it will sort the rate according to this customer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, if user1 also has a rate for customer2, it wont sort this rate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So basically it seems to not sort a second instance of a rate for the same user,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gregg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Feb 2012 19:04:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-function-in-an-expression/m-p/272100#M101927</guid>
      <dc:creator />
      <dc:date>2012-02-12T19:04:10Z</dc:date>
    </item>
    <item>
      <title>Re: Rank function in an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-function-in-an-expression/m-p/272101#M101928</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;My issue was that there in some circumstances was a total by the same person for 2 customers which gave them a TOTAL rate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;this total rate was across every customer so when trying to sort the column it would be inconsistent as it was not per&amp;nbsp; individual customer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;Thanks,&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;Gregg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Feb 2012 14:53:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-function-in-an-expression/m-p/272101#M101928</guid>
      <dc:creator />
      <dc:date>2012-02-17T14:53:36Z</dc:date>
    </item>
  </channel>
</rss>

