<?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: How to sort x-axis dimension according to a string? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-sort-x-axis-dimension-according-to-a-string/m-p/576383#M544415</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;On the sort tab, check Sort by Expression, and enter =COMP into the expression box. You may need to check Text as well&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BTW, sorting alphabetically should sort to CAB&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 29 Apr 2014 14:33:19 GMT</pubDate>
    <dc:creator>jonathandienst</dc:creator>
    <dc:date>2014-04-29T14:33:19Z</dc:date>
    <item>
      <title>How to sort x-axis dimension according to a string?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-sort-x-axis-dimension-according-to-a-string/m-p/576382#M544414</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 have created a bar chart with the product name as the primary dimension which gives the x-axis. Each product has an associated COMPOSITION string which indicates the four main components, and I would like the order of the products according to this string. For example, I have&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROD&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ITEM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; VAL&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; COMP&lt;/P&gt;&lt;P&gt;productA&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foo&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 41&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Brick.Concrete.Steel.Glass&lt;/P&gt;&lt;P&gt;productA&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bar&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Brick.Concrete.Steel.Glass&lt;/P&gt;&lt;P&gt;productB&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foo&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 21&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Concrete.Steel.Glass.Brick&lt;/P&gt;&lt;P&gt;productB&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bar&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 9&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Concrete.Steel.Glass.Brick&lt;/P&gt;&lt;P&gt;productC&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foo&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 17&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Brick.Concrete.Glass.Steel&lt;/P&gt;&lt;P&gt;productC&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bar&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Brick.Concrete.Glass.Steel&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;with the PROD as the x-axis dimension and ITEM as the second dimension for stacked bars. Now I want productA and productC to be displayed next to each other, since they have the most similar components (and productA first, since Glass is alphabetically before Steel).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to Sort the PROD dimension by the expression = COMP, but this didn't help. I wondered whether Qlikview is confused because each productA has two COMP values, and tried MaxString(COMP) for aggregation. But still the sort order seems to be arbitrary.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the simple example, I could use a match function (match(COMP,'Brick.Concrete.Steel.Glass',....)) - but in fact I have 17 differenct major components, not in 4^17 combinations but in a lot of them, and new products may have a new one. Therefore I'd rather avoid this, and it can't be so hard to sort by alphabet?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can someone help me, thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Apr 2014 14:25:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-sort-x-axis-dimension-according-to-a-string/m-p/576382#M544414</guid>
      <dc:creator />
      <dc:date>2014-04-29T14:25:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to sort x-axis dimension according to a string?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-sort-x-axis-dimension-according-to-a-string/m-p/576383#M544415</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;On the sort tab, check Sort by Expression, and enter =COMP into the expression box. You may need to check Text as well&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BTW, sorting alphabetically should sort to CAB&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Apr 2014 14:33:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-sort-x-axis-dimension-according-to-a-string/m-p/576383#M544415</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2014-04-29T14:33:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to sort x-axis dimension according to a string?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-sort-x-axis-dimension-according-to-a-string/m-p/576384#M544416</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hm, well - that is just what I originally did. Items with the same COMP string are &lt;EM&gt;often&lt;/EM&gt; next to each other after that, but not always, and there is no sorting of items with different COMP strings - if I do a manual numbering of the strings, I get e.g. 10, 25, 1, 26, 8, 8, 34, 8, 42, 41, and so on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I made a screenshot to illustrate this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jiveImage" src="https://community.qlik.com/legacyfs/online/58161_pastedImage_1.png" style="width: 620px; height: 344px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The sort window looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jiveImage" src="https://community.qlik.com/legacyfs/online/58162_pastedImage_2.png" style="width: 620px; height: 522px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am I doing something wrong? Is there some special setting I may have wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TIA, Frank&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Apr 2014 05:35:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-sort-x-axis-dimension-according-to-a-string/m-p/576384#M544416</guid>
      <dc:creator />
      <dc:date>2014-04-30T05:35:26Z</dc:date>
    </item>
  </channel>
</rss>

