<?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: Ranking multiple dimensions and sorting, script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Ranking-multiple-dimensions-and-sorting-script/m-p/1060610#M931970</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What I ultimately want to achieve is a chart that has a row for each delivery and then the top 3 dimensions that caused the delay or the delivery to be early like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" height="116" style="width: 504px; height: 106px;" width="504"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl65" height="25" width="88"&gt;Delivery&lt;/TD&gt;&lt;TD class="xl65" width="208"&gt;1&lt;/TD&gt;&lt;TD class="xl65" width="198"&gt;2&lt;/TD&gt;&lt;TD class="xl65" width="131"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="25"&gt;123456&lt;/TD&gt;&lt;TD class="xl65"&gt;Dimension 7, 12&lt;/TD&gt;&lt;TD class="xl65"&gt;Dimension 5, 6&lt;/TD&gt;&lt;TD class="xl65"&gt;Dimension 1, 2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="25"&gt;123457&lt;/TD&gt;&lt;TD class="xl65"&gt;Dimension 6, -11&lt;/TD&gt;&lt;TD class="xl65"&gt;Dimension 5, -6&lt;/TD&gt;&lt;TD class="xl65"&gt;Dimension 1, -2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="25"&gt;123458&lt;/TD&gt;&lt;TD class="xl65"&gt;Dimension 4, 20&lt;/TD&gt;&lt;TD class="xl65"&gt;Dimension 10, 4&lt;/TD&gt;&lt;TD class="xl65"&gt;Dimension 3, 2&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, I was wondering if there's a way to create a dimension for each delivery that has rank 1, 2 and 3 that can easily be brought into a chart or graph without using a calculated dimension. I could probably do it with an extremely long nested if statement but I'm thinking there's probably an easier way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Again, thank you for any ideas or suggestions you may have.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 01 Mar 2016 14:20:20 GMT</pubDate>
    <dc:creator />
    <dc:date>2016-03-01T14:20:20Z</dc:date>
    <item>
      <title>Ranking multiple dimensions and sorting, script</title>
      <link>https://community.qlik.com/t5/QlikView/Ranking-multiple-dimensions-and-sorting-script/m-p/1060608#M931968</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am having a hard time visualizing how to do the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a list of deliveries with 10 different deviations that are integers. Each deviation is a dimension in the script representing the difference between when an order was supposed to achieve a milestone compared to when it actually did (so if it was 2 days late to deliver, the integer would be +2). What I want to do is have the script rank all of these milestones in descending order if the order was late and ascending order if the order was early and then use that rank to see which deviation was the highest, 2nd highest, etc if the order was late or lowest, 2nd lowest, etc if the order was early.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas? I am guessing it's some kind of grouping in the script with a peek (?).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for any help or ideas!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Mar 2016 12:57:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Ranking-multiple-dimensions-and-sorting-script/m-p/1060608#M931968</guid>
      <dc:creator />
      <dc:date>2016-03-01T12:57:56Z</dc:date>
    </item>
    <item>
      <title>Re: Ranking multiple dimensions and sorting, script</title>
      <link>https://community.qlik.com/t5/QlikView/Ranking-multiple-dimensions-and-sorting-script/m-p/1060609#M931969</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you have a sample or an example of what you want to achieve?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With what you describe, you could not just load all, and then do the ranking/sorting in a chart?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Mar 2016 14:04:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Ranking-multiple-dimensions-and-sorting-script/m-p/1060609#M931969</guid>
      <dc:creator>puttemans</dc:creator>
      <dc:date>2016-03-01T14:04:56Z</dc:date>
    </item>
    <item>
      <title>Re: Ranking multiple dimensions and sorting, script</title>
      <link>https://community.qlik.com/t5/QlikView/Ranking-multiple-dimensions-and-sorting-script/m-p/1060610#M931970</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What I ultimately want to achieve is a chart that has a row for each delivery and then the top 3 dimensions that caused the delay or the delivery to be early like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" height="116" style="width: 504px; height: 106px;" width="504"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl65" height="25" width="88"&gt;Delivery&lt;/TD&gt;&lt;TD class="xl65" width="208"&gt;1&lt;/TD&gt;&lt;TD class="xl65" width="198"&gt;2&lt;/TD&gt;&lt;TD class="xl65" width="131"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="25"&gt;123456&lt;/TD&gt;&lt;TD class="xl65"&gt;Dimension 7, 12&lt;/TD&gt;&lt;TD class="xl65"&gt;Dimension 5, 6&lt;/TD&gt;&lt;TD class="xl65"&gt;Dimension 1, 2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="25"&gt;123457&lt;/TD&gt;&lt;TD class="xl65"&gt;Dimension 6, -11&lt;/TD&gt;&lt;TD class="xl65"&gt;Dimension 5, -6&lt;/TD&gt;&lt;TD class="xl65"&gt;Dimension 1, -2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="25"&gt;123458&lt;/TD&gt;&lt;TD class="xl65"&gt;Dimension 4, 20&lt;/TD&gt;&lt;TD class="xl65"&gt;Dimension 10, 4&lt;/TD&gt;&lt;TD class="xl65"&gt;Dimension 3, 2&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, I was wondering if there's a way to create a dimension for each delivery that has rank 1, 2 and 3 that can easily be brought into a chart or graph without using a calculated dimension. I could probably do it with an extremely long nested if statement but I'm thinking there's probably an easier way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Again, thank you for any ideas or suggestions you may have.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Mar 2016 14:20:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Ranking-multiple-dimensions-and-sorting-script/m-p/1060610#M931970</guid>
      <dc:creator />
      <dc:date>2016-03-01T14:20:20Z</dc:date>
    </item>
    <item>
      <title>Re: Ranking multiple dimensions and sorting, script</title>
      <link>https://community.qlik.com/t5/QlikView/Ranking-multiple-dimensions-and-sorting-script/m-p/1060611#M931971</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 think it depend on how you calculate your deviation.&lt;/P&gt;&lt;P&gt;You are supposed to have negative values if you perform "Supposed achievment"-"Real Achievement".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Supposed achievement&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Real Achievement&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Deviation&lt;/P&gt;&lt;P&gt;01/03/2016&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 03/03/2016&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -2&lt;/P&gt;&lt;P&gt;04/03/2016&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 03/03/2016&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this case you can sort your chart as descending/ascending.&lt;/P&gt;&lt;P&gt;Then you can add a KPI containing the avg(Deviation) and color it in RED if it's a negative value and GREEN if it's positive to get a tendance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds,&lt;/P&gt;&lt;P&gt;Philippe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Mar 2016 15:51:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Ranking-multiple-dimensions-and-sorting-script/m-p/1060611#M931971</guid>
      <dc:creator />
      <dc:date>2016-03-01T15:51:20Z</dc:date>
    </item>
    <item>
      <title>Re: Ranking multiple dimensions and sorting, script</title>
      <link>https://community.qlik.com/t5/QlikView/Ranking-multiple-dimensions-and-sorting-script/m-p/1060612#M931972</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Philippe,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply. What I'm really looking for is a way to rank the multiple dimensions for each delivery so that I can choose the top N or bottom N values. Each delivery has potentially different values for each deviation depending on what happened in the supply chain. So, would it be a good idea to establish that in the script or within some sort of calculated dimension?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Martin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Mar 2016 18:25:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Ranking-multiple-dimensions-and-sorting-script/m-p/1060612#M931972</guid>
      <dc:creator />
      <dc:date>2016-03-01T18:25:27Z</dc:date>
    </item>
    <item>
      <title>Re: Ranking multiple dimensions and sorting, script</title>
      <link>https://community.qlik.com/t5/QlikView/Ranking-multiple-dimensions-and-sorting-script/m-p/1060613#M931973</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;1-First you could create a table with 3 columns:&lt;/P&gt;&lt;P&gt;Delivery | Deviation value | Deviation ID&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2-Then create 2 temporary tables :&lt;/P&gt;&lt;P&gt;First one sorted per Delivery &amp;amp; Deviation value (ascending).&lt;/P&gt;&lt;P&gt;Second one sorted per Delivery &amp;amp; Deviation&amp;nbsp; value (descending).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3-Your final table will be:&lt;/P&gt;&lt;P&gt;Delivery | if (Avg([Deviation values]&amp;gt;0, X,x) | if (Avg([Deviation values]&amp;gt;0, Y,y) | if (Avg([Deviation values]&amp;gt;0, Z,z)&lt;/P&gt;&lt;P&gt;where X Y Z are the 3 First values of descending sorted column and x y z are the 3 First values of ascending sorted column.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know that my answer is not complete and I'm not sure it works. I didn't get time to test it also. But I hope it could help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Philippe &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Mar 2016 16:10:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Ranking-multiple-dimensions-and-sorting-script/m-p/1060613#M931973</guid>
      <dc:creator />
      <dc:date>2016-03-03T16:10:06Z</dc:date>
    </item>
    <item>
      <title>Re: Ranking multiple dimensions and sorting, script</title>
      <link>https://community.qlik.com/t5/QlikView/Ranking-multiple-dimensions-and-sorting-script/m-p/1060614#M931974</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, again for your help, Philippe. I see what you mean but I think that would only work for a small number of deliveries when I have to do it for thousands.&lt;/P&gt;&lt;P&gt;I am thinking that I have to create new dimensions in the script from 1 to 10 and rank each value for each delivery. Then, load them as 1, 2, 3, etc. My only concern is how to handle the values that tie, I think.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Mar 2016 13:00:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Ranking-multiple-dimensions-and-sorting-script/m-p/1060614#M931974</guid>
      <dc:creator />
      <dc:date>2016-03-07T13:00:57Z</dc:date>
    </item>
    <item>
      <title>Re: Ranking multiple dimensions and sorting, script</title>
      <link>https://community.qlik.com/t5/QlikView/Ranking-multiple-dimensions-and-sorting-script/m-p/1060615#M931975</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does the aggr function sort values? So is there a way to rank 10 dimensions of each delivery and then rank those values?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Mar 2016 13:56:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Ranking-multiple-dimensions-and-sorting-script/m-p/1060615#M931975</guid>
      <dc:creator />
      <dc:date>2016-03-11T13:56:04Z</dc:date>
    </item>
  </channel>
</rss>

