<?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 Expression by Numbers/Symbols in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Sort-Expression-by-Numbers-Symbols/m-p/685303#M248373</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Kaushik, &lt;/P&gt;&lt;P&gt;Thank you so much for the reply! I've tried this out and I'm able to sort "&amp;lt;" infront and "&amp;gt;" behind. However, the numbers in the middles like 2,3,4,6,7,8 are all jumbled up and not according to ascending order &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; Sorting by ascending doesn't work either. Any idea how do I solve that? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 16 Jul 2014 09:21:45 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-07-16T09:21:45Z</dc:date>
    <item>
      <title>Sort Expression by Numbers/Symbols</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-Expression-by-Numbers-Symbols/m-p/685299#M248369</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Is it possible for me to sort my chart in a way where any value with a &lt;STRONG&gt;" &amp;lt; " will always be infront,&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;values with only &lt;STRONG&gt;numbers will always in the middle&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;and values with &lt;STRONG&gt;" &amp;gt; " will always be at the back&lt;/STRONG&gt;?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example if I have values of: &amp;lt;1, 3, 6, 7, 8, &amp;gt;9, 2, 4&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It will automatically be sorted by: &lt;STRONG&gt;&amp;lt;1 , 2, 3 , 4 , 6, 7, 8 , &amp;gt;9&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I understand that I can do something like:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;if(Order='&amp;lt;1',1,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;if(Order='2',2,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;if(Order='3',3,4)))))))&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;and so on, BUT this method will require me to enter the specific values I want it to be sorted by.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I want is just to state that:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;"&amp;lt;" ,1 &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;number, 2&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;"&amp;gt;" 3&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;and whenever I choose my dimensions, it will be sorted this way via expressions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible and how do I go about doing so?&lt;/P&gt;&lt;P&gt;Thank you!! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jul 2014 08:37:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-Expression-by-Numbers-Symbols/m-p/685299#M248369</guid>
      <dc:creator />
      <dc:date>2014-07-16T08:37:39Z</dc:date>
    </item>
    <item>
      <title>Re: Sort Expression by Numbers/Symbols</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-Expression-by-Numbers-Symbols/m-p/685300#M248370</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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; You can use the "Expression" option of the "Sort" Tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Here you can write the expression as &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(wildmatch(Order,'&amp;lt;*'),1,if(Wildmatch(Order,'&amp;gt;*'),100,Order))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kaushik Solanki&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jul 2014 08:45:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-Expression-by-Numbers-Symbols/m-p/685300#M248370</guid>
      <dc:creator>kaushiknsolanki</dc:creator>
      <dc:date>2014-07-16T08:45:54Z</dc:date>
    </item>
    <item>
      <title>Re: Sort Expression by Numbers/Symbols</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-Expression-by-Numbers-Symbols/m-p/685301#M248371</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;Try something like this:&lt;/P&gt;&lt;P&gt;if (left(Order,1) = '&amp;lt;',&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dual(Order,1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (left(Order,1) = '&amp;gt;',&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dual(Order,9),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; num(Order)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then in the chart use sorting by Number to get the right result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers!&lt;/P&gt;&lt;P&gt;Janusz&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jul 2014 08:47:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-Expression-by-Numbers-Symbols/m-p/685301#M248371</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-07-16T08:47:27Z</dc:date>
    </item>
    <item>
      <title>Re: Sort Expression by Numbers/Symbols</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-Expression-by-Numbers-Symbols/m-p/685302#M248372</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;You try using dual function.&lt;/P&gt;&lt;P class="syntax"&gt;&lt;SPAN class="Bold"&gt;&lt;SPAN style="background-color: #3399ff; color: #ffffff;"&gt;dual&lt;/SPAN&gt;( &lt;/SPAN&gt;&lt;SPAN class="Italic"&gt;s , x&lt;/SPAN&gt;&lt;SPAN class="Bold"&gt; )&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;Forced association of an arbitrary string representation &lt;SPAN class="Italic"&gt;s&lt;/SPAN&gt; with a given number representation &lt;SPAN class="Italic"&gt;x&lt;/SPAN&gt;. In QlikView, when several data items read into one field have different string representations but the same valid number representation, they will all share the first string representation encountered. The &lt;SPAN style="background-color: #3399ff; color: #ffffff;"&gt;dual&lt;/SPAN&gt; function is typically used early in the script, before other data is read into the field concerned, in order to create that first string representation, which will be shown in list boxes etc. &lt;/P&gt;&lt;P class="example"&gt;Example:&lt;/P&gt;&lt;P class="Code"&gt;load &lt;SPAN style="background-color: #3399ff; color: #ffffff;"&gt;dual&lt;/SPAN&gt; ( string,numrep ) as DayOfWeek inline &lt;/P&gt;&lt;P class="Code"&gt;[ string,numrep &lt;/P&gt;&lt;P class="Code"&gt;Monday,0 &lt;/P&gt;&lt;P class="Code"&gt;Tuesday,1 &lt;/P&gt;&lt;P class="Code"&gt;Wednesday,2 &lt;/P&gt;&lt;P class="Code"&gt;Thursday,3 &lt;/P&gt;&lt;P class="Code"&gt;Friday,4 &lt;/P&gt;&lt;P class="Code"&gt;Saturday,5 &lt;/P&gt;&lt;P class="Code"&gt;Sunday,6 ]; &lt;/P&gt;&lt;P class="Code"&gt;load Date, weekday(Date) as DayOfWeek from afile.csv; &lt;/P&gt;&lt;P&gt;The script example will generate a field &lt;SPAN class="Italic"&gt;DayOfWeek&lt;/SPAN&gt; with the weekdays written in clear text. QlikView will for all purposes regard the field as a numeric field. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OR use Custom Sort Order.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Custom Sort Order:&lt;/P&gt;&lt;P&gt;Sometimes a desired sort order does not follow a natural alpha or numeric sort pattern. For example, there may be project phase names that should appear in charts in this specific order:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Design&lt;/P&gt;&lt;P&gt;Review&lt;/P&gt;&lt;P&gt;Budget&lt;/P&gt;&lt;P&gt;Implementation&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One of the Sortby&amp;nbsp; options available in chart properties is “Load Order”.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A specific Load Order for a field can be created by loading a dummy table with the desired order prior to loading the source data. The dummy table “PhaseSort” may be dropped after loading the source data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Load a dummy table to establish &lt;/P&gt;&lt;P&gt;// sort order for field “Phase”.&lt;/P&gt;&lt;P&gt;PhaseSort:&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;Phase&lt;/P&gt;&lt;P&gt;Design&lt;/P&gt;&lt;P&gt;Review&lt;/P&gt;&lt;P&gt;Budget&lt;/P&gt;&lt;P&gt;Implementation&lt;/P&gt;&lt;P&gt;]&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Load the source data&lt;/P&gt;&lt;P&gt;Fact:&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;ProjectId, Phase, Amount&lt;/P&gt;&lt;P&gt;FROM projects.qvd (qvd)&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Dummy table no longer needed&lt;/P&gt;&lt;P&gt;DROP TABLE PhaseSort;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jul 2014 08:50:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-Expression-by-Numbers-Symbols/m-p/685302#M248372</guid>
      <dc:creator>Siva_Sankar</dc:creator>
      <dc:date>2014-07-16T08:50:42Z</dc:date>
    </item>
    <item>
      <title>Re: Sort Expression by Numbers/Symbols</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-Expression-by-Numbers-Symbols/m-p/685303#M248373</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Kaushik, &lt;/P&gt;&lt;P&gt;Thank you so much for the reply! I've tried this out and I'm able to sort "&amp;lt;" infront and "&amp;gt;" behind. However, the numbers in the middles like 2,3,4,6,7,8 are all jumbled up and not according to ascending order &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; Sorting by ascending doesn't work either. Any idea how do I solve that? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jul 2014 09:21:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-Expression-by-Numbers-Symbols/m-p/685303#M248373</guid>
      <dc:creator />
      <dc:date>2014-07-16T09:21:45Z</dc:date>
    </item>
  </channel>
</rss>

