<?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 Sorting Alphanumeric values in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Sorting-Alphanumeric-values/m-p/141353#M21064</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rob,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you are absolutely right. I vaguely remember reading an announcement that QlikView is adopting "natural sorting" for more logical sorting of mixed strings. For example, the following values:&lt;/P&gt;&lt;P&gt;A1B&lt;/P&gt;&lt;P&gt;A2Z&lt;/P&gt;&lt;P&gt;A9K&lt;/P&gt;&lt;P&gt;A11&lt;/P&gt;&lt;P&gt;A19&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;will be sorted in this exact order, even though regular "alphabetical sort order" would place 11 before 9...&lt;/P&gt;&lt;P&gt;Oleg&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Apr 2009 07:15:41 GMT</pubDate>
    <dc:creator>Oleg_Troyansky</dc:creator>
    <dc:date>2009-04-16T07:15:41Z</dc:date>
    <item>
      <title>Sorting Alphanumeric values</title>
      <link>https://community.qlik.com/t5/QlikView/Sorting-Alphanumeric-values/m-p/141351#M21062</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 loaded the following in an inline table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;&lt;BR /&gt;hold:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt; F1&lt;BR /&gt; 200240AO&lt;BR /&gt; 500072CT&lt;BR /&gt; BRIDESCT&lt;BR /&gt; 200270AO&lt;BR /&gt; WS1000CT&lt;BR /&gt; WS1000RZ&lt;BR /&gt; 8CS077CT&lt;BR /&gt;];&amp;lt;div&amp;gt;&lt;/PRE&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Once loaded I create a list box and set the sort to Text ascending and get the following:&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;8CS077CT&lt;/DIV&gt;&lt;DIV&gt;200240AO&lt;/DIV&gt;&lt;DIV&gt;200270AO&lt;/DIV&gt;&lt;DIV&gt;500072CT&lt;/DIV&gt;&lt;DIV&gt;BRIDESCT&lt;/DIV&gt;&lt;DIV&gt;WS1000CT&lt;/DIV&gt;&lt;DIV&gt;WS1000RZ&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;If I change my listbox to use and expression --&amp;gt; Text(F1), then the sort is done properly:&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;200240AO&lt;/DIV&gt;&lt;DIV&gt;200270AO&lt;/DIV&gt;&lt;DIV&gt;500072CT&lt;/DIV&gt;&lt;DIV&gt;8CS077CT&lt;/DIV&gt;&lt;DIV&gt;BRIDESCT&lt;/DIV&gt;&lt;DIV&gt;WS1000CT&lt;/DIV&gt;&lt;DIV&gt;WS1000RZ&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Trying to figure out what QV is thinking. I even tried the following code:&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;----------------------&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;Text:&lt;/DIV&gt;&lt;DIV&gt;LOAD&lt;/DIV&gt;&lt;DIV&gt;Text(F1) as TextField&lt;/DIV&gt;&lt;DIV&gt;RESIDENT hold;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;-------------------------&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;But it still sorted as follows:&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;8CS077CT&lt;/DIV&gt;&lt;DIV&gt;200240AO&lt;/DIV&gt;&lt;DIV&gt;200270AO&lt;/DIV&gt;&lt;DIV&gt;500072CT&lt;/DIV&gt;&lt;DIV&gt;BRIDESCT&lt;/DIV&gt;&lt;DIV&gt;WS1000CT&lt;/DIV&gt;&lt;DIV&gt;WS1000RZ&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Thanks for the help.&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;Mark&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Apr 2009 21:30:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sorting-Alphanumeric-values/m-p/141351#M21062</guid>
      <dc:creator>markmccoid</dc:creator>
      <dc:date>2009-04-15T21:30:24Z</dc:date>
    </item>
    <item>
      <title>Sorting Alphanumeric values</title>
      <link>https://community.qlik.com/t5/QlikView/Sorting-Alphanumeric-values/m-p/141352#M21063</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's an odd one all right. I note that even using an expression like&lt;/P&gt;&lt;P&gt;=F1&lt;/P&gt;&lt;P&gt;gives the expected sort order.&lt;/P&gt;&lt;P&gt;I think I see a pattern to the sort. The values that start with numbers get stripped starting at the first alpha and the resulting number string is sorted using string sorting rules. So what is being sorted is:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;8&lt;/DIV&gt;&lt;DIV&gt;200240&lt;/DIV&gt;&lt;DIV&gt;200270&lt;/DIV&gt;&lt;DIV&gt;500072&lt;/DIV&gt;&lt;DIV&gt;BRIDESCT&lt;/DIV&gt;&lt;DIV&gt;WS1000CT&lt;/DIV&gt;&lt;DIV&gt;WS1000RZ&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;You can play with values like 5Z, 50Z &amp;amp; 80Z and see the pattern easier. Like your test, making another variable in the load -- even 'A' &amp;amp; F1 -- doesn't seem to fix it. But using that same expression (any expression) in a listbox gives the correct sort.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;I would inquire with Support on this one. Let me know what you find out.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;-Rob&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Apr 2009 07:02:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sorting-Alphanumeric-values/m-p/141352#M21063</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2009-04-16T07:02:00Z</dc:date>
    </item>
    <item>
      <title>Sorting Alphanumeric values</title>
      <link>https://community.qlik.com/t5/QlikView/Sorting-Alphanumeric-values/m-p/141353#M21064</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rob,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you are absolutely right. I vaguely remember reading an announcement that QlikView is adopting "natural sorting" for more logical sorting of mixed strings. For example, the following values:&lt;/P&gt;&lt;P&gt;A1B&lt;/P&gt;&lt;P&gt;A2Z&lt;/P&gt;&lt;P&gt;A9K&lt;/P&gt;&lt;P&gt;A11&lt;/P&gt;&lt;P&gt;A19&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;will be sorted in this exact order, even though regular "alphabetical sort order" would place 11 before 9...&lt;/P&gt;&lt;P&gt;Oleg&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Apr 2009 07:15:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sorting-Alphanumeric-values/m-p/141353#M21064</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2009-04-16T07:15:41Z</dc:date>
    </item>
    <item>
      <title>Sorting Alphanumeric values</title>
      <link>https://community.qlik.com/t5/QlikView/Sorting-Alphanumeric-values/m-p/141354#M21065</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oleg,&lt;/P&gt;&lt;P&gt;Thanks for the clarification. Looks like the workaround is to use an expression if we want the "ASCIIbetical" sort. This seems to work for chart dimensions as well.&lt;/P&gt;&lt;P&gt;Here's a blog post that explains a "Natural Sorting" algorithm.&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.davekoelle.com/alphanum.html"&gt;http://www.davekoelle.com/alphanum.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Apr 2009 07:58:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sorting-Alphanumeric-values/m-p/141354#M21065</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2009-04-16T07:58:49Z</dc:date>
    </item>
  </channel>
</rss>

