<?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 Straight Table - Sort Dimension by more than one criterium in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Straight-Table-Sort-Dimension-by-more-than-one-criterium/m-p/292534#M495964</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm new to QlikView and new to the QlikCommunity.&lt;/P&gt;&lt;P&gt;My problem is that I do not know how to sort a Straight Table on two criteria.&lt;/P&gt;&lt;P&gt;It's a table of S&amp;amp;P credit ratings:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A&lt;/P&gt;&lt;P&gt;A-&lt;/P&gt;&lt;P&gt;A+&lt;/P&gt;&lt;P&gt;AA&lt;/P&gt;&lt;P&gt;AA-&lt;/P&gt;&lt;P&gt;AAA&lt;/P&gt;&lt;P&gt;B+&lt;BR /&gt;BB&lt;/P&gt;&lt;P&gt;BB-&lt;/P&gt;&lt;P&gt;...etc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to sort the ratings, firstly, in ascending alphabetical order (ie. A -&amp;gt; Z) based on the first character then, secondly, on the second character, thirdly, on the third character, and so on so that they look more like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AAA&lt;/P&gt;&lt;P&gt;AA+&lt;/P&gt;&lt;P&gt;AA&lt;/P&gt;&lt;P&gt;AA-&lt;/P&gt;&lt;P&gt;A+&lt;/P&gt;&lt;P&gt;A&lt;/P&gt;&lt;P&gt;A-&lt;/P&gt;&lt;P&gt;BBB+&lt;/P&gt;&lt;P&gt;BBB&lt;/P&gt;&lt;P&gt;BBB-&lt;/P&gt;&lt;P&gt;BB+&lt;/P&gt;&lt;P&gt;BB&lt;/P&gt;&lt;P&gt;BB-&lt;/P&gt;&lt;P&gt;B+&lt;/P&gt;&lt;P&gt;B&lt;/P&gt;&lt;P&gt;B-&lt;/P&gt;&lt;P&gt;...etc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can this be done with an Expression?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 20 Jan 2012 09:09:55 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-01-20T09:09:55Z</dc:date>
    <item>
      <title>Straight Table - Sort Dimension by more than one criterium</title>
      <link>https://community.qlik.com/t5/QlikView/Straight-Table-Sort-Dimension-by-more-than-one-criterium/m-p/292534#M495964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm new to QlikView and new to the QlikCommunity.&lt;/P&gt;&lt;P&gt;My problem is that I do not know how to sort a Straight Table on two criteria.&lt;/P&gt;&lt;P&gt;It's a table of S&amp;amp;P credit ratings:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A&lt;/P&gt;&lt;P&gt;A-&lt;/P&gt;&lt;P&gt;A+&lt;/P&gt;&lt;P&gt;AA&lt;/P&gt;&lt;P&gt;AA-&lt;/P&gt;&lt;P&gt;AAA&lt;/P&gt;&lt;P&gt;B+&lt;BR /&gt;BB&lt;/P&gt;&lt;P&gt;BB-&lt;/P&gt;&lt;P&gt;...etc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to sort the ratings, firstly, in ascending alphabetical order (ie. A -&amp;gt; Z) based on the first character then, secondly, on the second character, thirdly, on the third character, and so on so that they look more like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AAA&lt;/P&gt;&lt;P&gt;AA+&lt;/P&gt;&lt;P&gt;AA&lt;/P&gt;&lt;P&gt;AA-&lt;/P&gt;&lt;P&gt;A+&lt;/P&gt;&lt;P&gt;A&lt;/P&gt;&lt;P&gt;A-&lt;/P&gt;&lt;P&gt;BBB+&lt;/P&gt;&lt;P&gt;BBB&lt;/P&gt;&lt;P&gt;BBB-&lt;/P&gt;&lt;P&gt;BB+&lt;/P&gt;&lt;P&gt;BB&lt;/P&gt;&lt;P&gt;BB-&lt;/P&gt;&lt;P&gt;B+&lt;/P&gt;&lt;P&gt;B&lt;/P&gt;&lt;P&gt;B-&lt;/P&gt;&lt;P&gt;...etc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can this be done with an Expression?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jan 2012 09:09:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Straight-Table-Sort-Dimension-by-more-than-one-criterium/m-p/292534#M495964</guid>
      <dc:creator />
      <dc:date>2012-01-20T09:09:55Z</dc:date>
    </item>
    <item>
      <title>Straight Table - Sort Dimension by more than one criterium</title>
      <link>https://community.qlik.com/t5/QlikView/Straight-Table-Sort-Dimension-by-more-than-one-criterium/m-p/292535#M495965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe you can come up with some complex expression to sort it like you need.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I believe there are more simple ways to achieve this, since your credit ratings should be a defined set of values:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Either load your set of credit ratings with a inline load prior loading your tables with the ratings, thus the load order of the table could be used as sort order:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;﻿CreditRatings:&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;Rating&lt;/P&gt;&lt;P&gt;AAA&lt;/P&gt;&lt;P&gt;AA+&lt;/P&gt;&lt;P&gt;AA&lt;/P&gt;&lt;P&gt;AA-&lt;/P&gt;&lt;P&gt;A+&lt;/P&gt;&lt;P&gt;A&lt;/P&gt;&lt;P&gt;A-&lt;/P&gt;&lt;P&gt;BBB+&lt;/P&gt;&lt;P&gt;BBB&lt;/P&gt;&lt;P&gt;BBB-&lt;/P&gt;&lt;P&gt;BB+&lt;/P&gt;&lt;P&gt;BB&lt;/P&gt;&lt;P&gt;BB-&lt;/P&gt;&lt;P&gt;B+&lt;/P&gt;&lt;P&gt;B&lt;/P&gt;&lt;P&gt;B-&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(add more lines as needed. In your chart, use load order as sort order)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or explicitely set a numerical to each string, using this numerical as sort order:&lt;/P&gt;&lt;P&gt;CreditRating:&lt;/P&gt;&lt;P&gt;LOAD dual(Rating,Sortorder) as Rating INLINE [&lt;/P&gt;&lt;P&gt;Rating, Sortorder&lt;/P&gt;&lt;P&gt;AAA,1&lt;/P&gt;&lt;P&gt;AA+,2&lt;/P&gt;&lt;P&gt;AA,3&lt;/P&gt;&lt;P&gt;AA-,4&lt;/P&gt;&lt;P&gt;A+,5&lt;/P&gt;&lt;P&gt;A,6&lt;/P&gt;&lt;P&gt;A-,7&lt;/P&gt;&lt;P&gt;BBB+,8&lt;/P&gt;&lt;P&gt;BBB,9&lt;/P&gt;&lt;P&gt;BBB-,10&lt;/P&gt;&lt;P&gt;BB+,11&lt;/P&gt;&lt;P&gt;BB,12&lt;/P&gt;&lt;P&gt;BB-,13&lt;/P&gt;&lt;P&gt;B+,14&lt;/P&gt;&lt;P&gt;B,15&lt;/P&gt;&lt;P&gt;B-,16&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jan 2012 11:16:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Straight-Table-Sort-Dimension-by-more-than-one-criterium/m-p/292535#M495965</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-01-20T11:16:48Z</dc:date>
    </item>
  </channel>
</rss>

