<?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 Sort expression problem QV 8.5 in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Sort-expression-problem-QV-8-5/m-p/258760#M498113</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;aggr(Mid([Consultant],FindOneOf([Consultant], ' ', 2)),[Consultant])&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 09 Aug 2011 21:05:28 GMT</pubDate>
    <dc:creator>danielrozental</dc:creator>
    <dc:date>2011-08-09T21:05:28Z</dc:date>
    <item>
      <title>Sort expression problem QV 8.5</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-expression-problem-QV-8-5/m-p/258759#M498112</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi could someone please help?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a listbox which contains a list of Consultant names from a field called Consultants, e.g.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DR A RASHID&lt;/P&gt;&lt;P&gt;MR C TRUEMAN&lt;/P&gt;&lt;P&gt;DR B MEHTI&lt;/P&gt;&lt;P&gt;DR Z BIGELOW&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what I would like to do is sort this list on the surname so it would appear as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DR Z BIGELOW&lt;/P&gt;&lt;P&gt;DR B MEHTI&lt;/P&gt;&lt;P&gt;DR A RASHID&lt;/P&gt;&lt;P&gt;MR C TRUEMAN&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried to add a sort expression like so&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Mid([Consultant],FindOneOf([Consultant], ' ', 2))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so this will find the surname after the second space in the string.&amp;nbsp; If I create a new list box with this expression in as the field it displays as I would expect and is sortable&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BIGELOW&lt;/P&gt;&lt;P&gt;MEHTI&lt;/P&gt;&lt;P&gt;RASHID&lt;/P&gt;&lt;P&gt;TRUEMAN&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However this does not work if I use this to sort expression, I have tried all the different combinations of checkboxes to no avail&lt;/P&gt;&lt;P&gt;I have tried to make a new field in the load script like so&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mid([Consultant],FindOneOf([Consultant], ' ', 2)) as [Cons_Surname],&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The field is added and is available but I still cannot get it to sort correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to show the full string in the list box but for it to be sorted on the surname portion of the string&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot&lt;/P&gt;&lt;P&gt;Stephen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Aug 2011 11:18:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-expression-problem-QV-8-5/m-p/258759#M498112</guid>
      <dc:creator />
      <dc:date>2011-08-09T11:18:24Z</dc:date>
    </item>
    <item>
      <title>Sort expression problem QV 8.5</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-expression-problem-QV-8-5/m-p/258760#M498113</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;aggr(Mid([Consultant],FindOneOf([Consultant], ' ', 2)),[Consultant])&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Aug 2011 21:05:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-expression-problem-QV-8-5/m-p/258760#M498113</guid>
      <dc:creator>danielrozental</dc:creator>
      <dc:date>2011-08-09T21:05:28Z</dc:date>
    </item>
    <item>
      <title>Sort expression problem QV 8.5</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-expression-problem-QV-8-5/m-p/258761#M498114</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That doesnt work unfortunately, I get the same results&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any other ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;Stephen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Aug 2011 10:01:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-expression-problem-QV-8-5/m-p/258761#M498114</guid>
      <dc:creator />
      <dc:date>2011-08-10T10:01:22Z</dc:date>
    </item>
    <item>
      <title>Re: Sort expression problem QV 8.5</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-expression-problem-QV-8-5/m-p/258762#M498115</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;After more headaches this morning I have come up with a workaround to this problem&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Consultant field in its raw form contains&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DR A RASHIDSR0152&lt;/P&gt;&lt;P&gt;MR C TRUEMANSR0153&lt;/P&gt;&lt;P&gt;DR B MEHTISR0154&lt;/P&gt;&lt;P&gt;DR Z BIGELOWSR0152&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I now have an expression on the Consultant field in the list box&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Mid([Consultant],FindOneOf([Consultant], ' ', 2),Len(Mid([Consultant],FindOneOf([Consultant], ' ', 2)))-Len(Right([Consultant], 6))) &lt;/P&gt;&lt;P&gt;&amp;amp; ' ' &amp;amp; Left([Consultant], FindOneOf([Consultant], ' ', 2))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This identifies the surname portion of the consultant name first, &lt;/P&gt;strips out the SR0xxx number, then adds on the Prefix and initials.&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I then sort on State/Text Ascending&lt;/P&gt;&lt;P&gt;This works fine&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;like so&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BIGELOW DR Z&amp;nbsp; &lt;/P&gt;&lt;P&gt;MEHTI DR B &lt;/P&gt;&lt;P&gt;RASHID DR A &lt;/P&gt;&lt;P&gt;TRUEMAN MR C &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It would be nice to understand why the original solution didnt work though &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;Stephen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Aug 2011 13:31:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-expression-problem-QV-8-5/m-p/258762#M498115</guid>
      <dc:creator />
      <dc:date>2011-08-10T13:31:23Z</dc:date>
    </item>
    <item>
      <title>Re: Sort expression problem QV 8.5</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-expression-problem-QV-8-5/m-p/258763#M498116</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Stephen,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From my own experience it seems that the sort by expression is looking to sort by some numeric value returned by expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could therefore use hash128() around your original expression&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Aug 2011 13:52:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-expression-problem-QV-8-5/m-p/258763#M498116</guid>
      <dc:creator>jedgson</dc:creator>
      <dc:date>2011-08-10T13:52:22Z</dc:date>
    </item>
    <item>
      <title>Re: Sort expression problem QV 8.5</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-expression-problem-QV-8-5/m-p/258764#M498117</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thanks Jay I will bear that in mind for future reference&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Stephen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Aug 2011 14:59:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-expression-problem-QV-8-5/m-p/258764#M498117</guid>
      <dc:creator />
      <dc:date>2011-08-10T14:59:50Z</dc:date>
    </item>
  </channel>
</rss>

