<?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: Sort by expression whatever the selection in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Sort-by-expression-whatever-the-selection/m-p/622448#M229096</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 am looking for a solution for custom sort order in a graph that has cyclical dimension containing several fields that each require a custom sort order (as numerical/alphabetical sorting is not meaningful). In simple words, I have&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cyclical Group Dimension Field: Stage&lt;/P&gt;&lt;P&gt;Values: Good, Better, Stunning&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cyclical Group Dimension Field: Forecast&lt;/P&gt;&lt;P&gt;Values: Never, Guess, Likely, Sure&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;neither of the following sort expressions allow me to have above sorting orders in both fields when I swap from one to another in my graph's cyclical dimension button:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; =match([Stage], 'Good', 'Better', 'Stunning') or match([Forecast],'Never', 'Guess', 'Likely, 'Sure')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; =&amp;gt; only Stage is sorted&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; =match([Stage], 'Good', 'Better', 'Stunning')&lt;/P&gt;&lt;P&gt; =match([Forecast],'Never', 'Guess', 'Likely, 'Sure')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; =&amp;gt; only Stage is sorted&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what would be solutions in this case?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 28 May 2014 10:50:00 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-05-28T10:50:00Z</dc:date>
    <item>
      <title>Sort by expression whatever the selection</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-by-expression-whatever-the-selection/m-p/622441#M229089</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 have a table which contains one column "VALUE":&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="149" jive-data-cell="{&amp;quot;color&amp;quot;:&amp;quot;#575757&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;left&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;2&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;transparent&amp;quot;,&amp;quot;fontFamily&amp;quot;:&amp;quot;arial,helvetica,sans-serif&amp;quot;,&amp;quot;verticalAlign&amp;quot;:&amp;quot;baseline&amp;quot;}" jive-data-header="{&amp;quot;color&amp;quot;:&amp;quot;#FFFFFF&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;#6690BC&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;center&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;2&amp;quot;,&amp;quot;fontFamily&amp;quot;:&amp;quot;arial,helvetica,sans-serif&amp;quot;,&amp;quot;verticalAlign&amp;quot;:&amp;quot;baseline&amp;quot;}" style="border: 1px solid #000000; width: 49px; height: 151px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;NAME &lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #c0c0c0; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;ORDER &lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;A4&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;B2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;C3&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;D1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do not control the load order and I want name to be sorted like this:&lt;/P&gt;&lt;P&gt;D1&lt;/P&gt;&lt;P&gt;B2&lt;/P&gt;&lt;P&gt;C3&lt;/P&gt;&lt;P&gt;A4&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried both proposals from &lt;A href="http://www.qlikfix.com/2010/10/25/creating-a-custom-sort-order/" title="http://www.qlikfix.com/2010/10/25/creating-a-custom-sort-order/"&gt;Creating a custom sort order » The Qlik Fix! The Qlik Fix!&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Filter box: &lt;/STRONG&gt;(State = Ascending because I want user selection to be on top)&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN style="text-decoration: underline;"&gt;Sort by Match()&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P style="padding-left: 30px;"&gt;Expression = Ascending and equals to &lt;SPAN style="color: #000000; font-family: 'courier new', courier;"&gt;match(NAME, 'D', 'B', 'C', 'A')&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;It works fine if I have no selection. If I filter on C3, I should have&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #008000;"&gt;C3 (on top because of State)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;D1&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;B2&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;A4&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;but I get:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;C3&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;B2&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;A4&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;D1&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Sort by ORDER column&lt;/LI&gt;&lt;/UL&gt;&lt;P style="padding-left: 30px;"&gt;Expression = Ascending and equals to &lt;SPAN style="color: #000000; font-family: 'courier new', courier;"&gt;ORDER&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;Result is the same&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Graph:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Dimension = NAME&lt;/P&gt;&lt;P&gt;Expression = 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I only sort by expression ascending, State is not checked&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;It works fine if I have no selection. If I filter on C3, my x-axis should be:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;D1 &amp;gt; B2 &amp;gt; C3 &amp;gt; A4&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;but I get:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;A4 &amp;gt; B2 &amp;gt; D1 &amp;gt; C3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I believe this is because selecting C3, the other values are NULL hence, cannot be ordered so it is probably done randomly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I make sure I always get my order respected whatever the selection made (selection being on top in a filter box)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I attached the test app.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;jc&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Apr 2014 18:44:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-by-expression-whatever-the-selection/m-p/622441#M229089</guid>
      <dc:creator />
      <dc:date>2014-04-25T18:44:45Z</dc:date>
    </item>
    <item>
      <title>Re: Sort by expression whatever the selection</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-by-expression-whatever-the-selection/m-p/622442#M229090</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;i think if you want to resolve your problem you should use the "load order";&amp;nbsp; so change your&amp;nbsp; load script to this :&lt;/P&gt;&lt;P&gt;&lt;SPAN class="s1"&gt;&lt;STRONG&gt;LOAD&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN class="s2"&gt; * &lt;/SPAN&gt;&lt;SPAN class="s1"&gt;INLINE&lt;/SPAN&gt;&lt;SPAN class="s2"&gt; &lt;/SPAN&gt;[&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NAME, ORDER&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; D, 1&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; B, 2&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; C, 3&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; A, 4&lt;BR /&gt; ]&lt;SPAN class="s2"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="s2"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="s2"&gt;then in tour list box-&amp;gt; sort tab : State : Ascending ,Load order : original&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Apr 2014 21:30:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-by-expression-whatever-the-selection/m-p/622442#M229090</guid>
      <dc:creator>mambi</dc:creator>
      <dc:date>2014-04-25T21:30:47Z</dc:date>
    </item>
    <item>
      <title>Re: Sort by expression whatever the selection</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-by-expression-whatever-the-selection/m-p/622443#M229091</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have put a very simple example to ease understanding but the real table I am using is not INLINE, it is coming from a DB so your proposal won't work unfortunately.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That may work if was able to load the DB table with the order I need, but I do not know how to do that if it is not INLINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;jc&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 26 Apr 2014 12:58:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-by-expression-whatever-the-selection/m-p/622443#M229091</guid>
      <dc:creator />
      <dc:date>2014-04-26T12:58:17Z</dc:date>
    </item>
    <item>
      <title>Re: Sort by expression whatever the selection</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-by-expression-whatever-the-selection/m-p/622444#M229092</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use set ananlysis to disregard selection. Use sort expression like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=match(Only({1}NAME), 'D', 'B', 'C', 'A')&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 26 Apr 2014 13:04:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-by-expression-whatever-the-selection/m-p/622444#M229092</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2014-04-26T13:04:29Z</dc:date>
    </item>
    <item>
      <title>Re: Sort by expression whatever the selection</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-by-expression-whatever-the-selection/m-p/622445#M229093</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try it using order by clause in your query&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 26 Apr 2014 13:21:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-by-expression-whatever-the-selection/m-p/622445#M229093</guid>
      <dc:creator>mambi</dc:creator>
      <dc:date>2014-04-26T13:21:51Z</dc:date>
    </item>
    <item>
      <title>Re: Sort by expression whatever the selection</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-by-expression-whatever-the-selection/m-p/622446#M229094</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi try this &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;only({1}order)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;only({1}&lt;SPAN style="color: #000000; font-family: 'courier new', courier;"&gt;match(NAME, 'D', 'B', 'C', 'A')&lt;/SPAN&gt;)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 26 Apr 2014 13:37:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-by-expression-whatever-the-selection/m-p/622446#M229094</guid>
      <dc:creator>preminqlik</dc:creator>
      <dc:date>2014-04-26T13:37:42Z</dc:date>
    </item>
    <item>
      <title>Re: Sort by expression whatever the selection</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-by-expression-whatever-the-selection/m-p/622447#M229095</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;A list box that is sorted by an expression loses the sort order when a selection is made in the list box.&lt;/P&gt;&lt;P&gt;You need to sort by expression over the entire data set and not only the currently selected data set, thus you need to use a set of expression that include the desired data set (see attached example)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 26 Apr 2014 13:54:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-by-expression-whatever-the-selection/m-p/622447#M229095</guid>
      <dc:creator>Joseph_Musekura</dc:creator>
      <dc:date>2014-04-26T13:54:42Z</dc:date>
    </item>
    <item>
      <title>Re: Sort by expression whatever the selection</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-by-expression-whatever-the-selection/m-p/622448#M229096</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 am looking for a solution for custom sort order in a graph that has cyclical dimension containing several fields that each require a custom sort order (as numerical/alphabetical sorting is not meaningful). In simple words, I have&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cyclical Group Dimension Field: Stage&lt;/P&gt;&lt;P&gt;Values: Good, Better, Stunning&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cyclical Group Dimension Field: Forecast&lt;/P&gt;&lt;P&gt;Values: Never, Guess, Likely, Sure&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;neither of the following sort expressions allow me to have above sorting orders in both fields when I swap from one to another in my graph's cyclical dimension button:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; =match([Stage], 'Good', 'Better', 'Stunning') or match([Forecast],'Never', 'Guess', 'Likely, 'Sure')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; =&amp;gt; only Stage is sorted&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; =match([Stage], 'Good', 'Better', 'Stunning')&lt;/P&gt;&lt;P&gt; =match([Forecast],'Never', 'Guess', 'Likely, 'Sure')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; =&amp;gt; only Stage is sorted&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what would be solutions in this case?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 May 2014 10:50:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-by-expression-whatever-the-selection/m-p/622448#M229096</guid>
      <dc:creator />
      <dc:date>2014-05-28T10:50:00Z</dc:date>
    </item>
    <item>
      <title>Re: Sort by expression whatever the selection</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-by-expression-whatever-the-selection/m-p/1588236#M443341</link>
      <description>&lt;P&gt;This answer was very helpful.&amp;nbsp; I was having an issue where my most recent 3 months would be out of order when I selected a different year.&amp;nbsp; The only{1} option worked great.&amp;nbsp; Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jun 2019 14:24:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-by-expression-whatever-the-selection/m-p/1588236#M443341</guid>
      <dc:creator>kaylaramsey2</dc:creator>
      <dc:date>2019-06-04T14:24:55Z</dc:date>
    </item>
  </channel>
</rss>

