<?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 How to sort dimension values according to another dimension in Qlik Sense in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/How-to-sort-dimension-values-according-to-another-dimension-in/m-p/1944529#M77834</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;I have a bar chart with 1 dimension - Stations.&lt;BR /&gt;I have another dimension named Area. &lt;BR /&gt;The 2 tables, on which the dimensions are based, are linked. Each station is linked to one area. &lt;BR /&gt;for example:&amp;nbsp;&lt;/P&gt;
&lt;TABLE style="width: 300px;" border="1" width="300"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="58.8281px"&gt;&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;Station&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="51.0312px"&gt;&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;Area&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="40px"&gt;&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;sort&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="58.8281px"&gt;A&lt;/TD&gt;
&lt;TD width="51.0312px"&gt;North&lt;/TD&gt;
&lt;TD width="40px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="58.8281px"&gt;B&lt;/TD&gt;
&lt;TD width="51.0312px"&gt;South&lt;/TD&gt;
&lt;TD width="40px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="58.8281px"&gt;C&lt;/TD&gt;
&lt;TD width="51.0312px"&gt;West&lt;/TD&gt;
&lt;TD width="40px"&gt;2&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="58.8281px"&gt;D&lt;/TD&gt;
&lt;TD width="51.0312px"&gt;West&lt;/TD&gt;
&lt;TD width="40px"&gt;3&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="58.8281px"&gt;E&lt;/TD&gt;
&lt;TD width="51.0312px"&gt;North&lt;/TD&gt;
&lt;TD width="40px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="58.8281px"&gt;F&lt;/TD&gt;
&lt;TD width="51.0312px"&gt;West&lt;/TD&gt;
&lt;TD width="40px"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="58.8281px"&gt;G&lt;/TD&gt;
&lt;TD width="51.0312px"&gt;South&lt;/TD&gt;
&lt;TD width="40px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="58.8281px"&gt;H&lt;/TD&gt;
&lt;TD width="51.0312px"&gt;East&lt;/TD&gt;
&lt;TD width="40px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="58.8281px"&gt;I&lt;/TD&gt;
&lt;TD width="51.0312px"&gt;North&lt;/TD&gt;
&lt;TD width="40px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to sort the stations according to the chosen area. If you choose only 'West' I want to see the stations according to the sort column - &lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;F, C, D&lt;/STRONG&gt;&lt;/FONT&gt;. If you choose more than 1 area or any other area I want to see the stations alphabetically &lt;STRONG&gt;&lt;FONT color="#0000FF"&gt;A,B,C,D,E,.&lt;/FONT&gt;&lt;/STRONG&gt;...&lt;/P&gt;
&lt;P&gt;How can I do that?&lt;/P&gt;</description>
    <pubDate>Wed, 07 Sep 2022 18:28:29 GMT</pubDate>
    <dc:creator>adias102</dc:creator>
    <dc:date>2022-09-07T18:28:29Z</dc:date>
    <item>
      <title>How to sort dimension values according to another dimension in Qlik Sense</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-sort-dimension-values-according-to-another-dimension-in/m-p/1944529#M77834</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;I have a bar chart with 1 dimension - Stations.&lt;BR /&gt;I have another dimension named Area. &lt;BR /&gt;The 2 tables, on which the dimensions are based, are linked. Each station is linked to one area. &lt;BR /&gt;for example:&amp;nbsp;&lt;/P&gt;
&lt;TABLE style="width: 300px;" border="1" width="300"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="58.8281px"&gt;&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;Station&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="51.0312px"&gt;&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;Area&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="40px"&gt;&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;sort&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="58.8281px"&gt;A&lt;/TD&gt;
&lt;TD width="51.0312px"&gt;North&lt;/TD&gt;
&lt;TD width="40px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="58.8281px"&gt;B&lt;/TD&gt;
&lt;TD width="51.0312px"&gt;South&lt;/TD&gt;
&lt;TD width="40px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="58.8281px"&gt;C&lt;/TD&gt;
&lt;TD width="51.0312px"&gt;West&lt;/TD&gt;
&lt;TD width="40px"&gt;2&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="58.8281px"&gt;D&lt;/TD&gt;
&lt;TD width="51.0312px"&gt;West&lt;/TD&gt;
&lt;TD width="40px"&gt;3&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="58.8281px"&gt;E&lt;/TD&gt;
&lt;TD width="51.0312px"&gt;North&lt;/TD&gt;
&lt;TD width="40px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="58.8281px"&gt;F&lt;/TD&gt;
&lt;TD width="51.0312px"&gt;West&lt;/TD&gt;
&lt;TD width="40px"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="58.8281px"&gt;G&lt;/TD&gt;
&lt;TD width="51.0312px"&gt;South&lt;/TD&gt;
&lt;TD width="40px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="58.8281px"&gt;H&lt;/TD&gt;
&lt;TD width="51.0312px"&gt;East&lt;/TD&gt;
&lt;TD width="40px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="58.8281px"&gt;I&lt;/TD&gt;
&lt;TD width="51.0312px"&gt;North&lt;/TD&gt;
&lt;TD width="40px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to sort the stations according to the chosen area. If you choose only 'West' I want to see the stations according to the sort column - &lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;F, C, D&lt;/STRONG&gt;&lt;/FONT&gt;. If you choose more than 1 area or any other area I want to see the stations alphabetically &lt;STRONG&gt;&lt;FONT color="#0000FF"&gt;A,B,C,D,E,.&lt;/FONT&gt;&lt;/STRONG&gt;...&lt;/P&gt;
&lt;P&gt;How can I do that?&lt;/P&gt;</description>
      <pubDate>Wed, 07 Sep 2022 18:28:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-sort-dimension-values-according-to-another-dimension-in/m-p/1944529#M77834</guid>
      <dc:creator>adias102</dc:creator>
      <dc:date>2022-09-07T18:28:29Z</dc:date>
    </item>
    <item>
      <title>Re: sort dimension values according to another dimension</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-sort-dimension-values-according-to-another-dimension-in/m-p/1944577#M77837</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/99245"&gt;@adias102&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You are wanting to sort the station based on an expression. That expression will want to be something like:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;=if(count(distinct Area) = 1, sort, ord(Station))&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;This relies on the Station only having one character, or the first character being unique. If it is multiple characters you need to calculate a number to sort on based on multiple characters from station, e.g.:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;=if(count(distinct Area) = 1, sort, (ord(mid(Station,1,1))*100)+ord(mid(Station,2,1)))&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;If you have values that are not unique after two characters you will need to multiply the first character by 10000, second by 100 etc.&lt;/P&gt;
&lt;P&gt;Hope that helps.&lt;/P&gt;
&lt;P&gt;Steve&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2022 12:59:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-sort-dimension-values-according-to-another-dimension-in/m-p/1944577#M77837</guid>
      <dc:creator>stevedark</dc:creator>
      <dc:date>2022-06-16T12:59:50Z</dc:date>
    </item>
    <item>
      <title>Re: sort dimension values according to another dimension</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-sort-dimension-values-according-to-another-dimension-in/m-p/1944578#M77838</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;It's not what I meant, or I didn't understand the solution.&lt;/P&gt;
&lt;P&gt;If you choose the are 'West' and only this value I want to see the 3 related station in this order F,C,D.&lt;/P&gt;
&lt;P&gt;But, if you choose several areas (West &amp;amp; North) or any other area (South) I want to see the stations in alphabetical order.&lt;/P&gt;
&lt;P&gt;The actual stations' names have multiple characters and the first character is not unique.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2022 13:06:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-sort-dimension-values-according-to-another-dimension-in/m-p/1944578#M77838</guid>
      <dc:creator>adias102</dc:creator>
      <dc:date>2022-06-16T13:06:06Z</dc:date>
    </item>
    <item>
      <title>Re: sort dimension values according to another dimension</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-sort-dimension-values-according-to-another-dimension-in/m-p/1944584#M77839</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/99245"&gt;@adias102&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sorry, I assume you were meaning any single Area, in that case:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;=if(only(Area) = 'West', sort, (ord(mid(Station,1,1))*10000)+(ord(mid(Station,2,1))*100)+ord(mid(Station,3,1)))&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;This assumes you have a column called &lt;STRONG&gt;sort&lt;/STRONG&gt;, if you don't then the&amp;nbsp;&lt;STRONG&gt;sort&amp;nbsp;&lt;/STRONG&gt;part needs to change to only use Station:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;=if(only(Area) = 'West', match(Station, 'F','C','D'), (ord(mid(Station,1,1))*10000)+(ord(mid(Station,2,1))*100)+ord(mid(Station,3,1)))&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Hopefully that gets you where you need to be.&lt;/P&gt;
&lt;P&gt;Steve&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2022 13:13:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-sort-dimension-values-according-to-another-dimension-in/m-p/1944584#M77839</guid>
      <dc:creator>stevedark</dc:creator>
      <dc:date>2022-06-16T13:13:15Z</dc:date>
    </item>
    <item>
      <title>Re: sort dimension values according to another dimension</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-sort-dimension-values-according-to-another-dimension-in/m-p/1945337#M77910</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Thank you for the suggestions. Somehow, they didn't work.&lt;BR /&gt;Finally I found this solution and it works:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#0000FF"&gt;if(GetFieldSelections(Area)='West', Order2, Order1)&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;When&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;Area&lt;/FONT&gt; is the dimension&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;Order1&lt;/FONT&gt; and &lt;FONT color="#FF6600"&gt;Order2&lt;/FONT&gt; are 2 columns in my Station table&lt;/P&gt;</description>
      <pubDate>Sun, 19 Jun 2022 08:24:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-sort-dimension-values-according-to-another-dimension-in/m-p/1945337#M77910</guid>
      <dc:creator>adias102</dc:creator>
      <dc:date>2022-06-19T08:24:48Z</dc:date>
    </item>
  </channel>
</rss>

