<?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: Listbox sorting by expression not working in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Listbox-sorting-by-expression-not-working/m-p/1784383#M1209858</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/62450"&gt;@VivenReddy&lt;/a&gt;, sort by expression expects a number to sort, you can try with:&lt;/P&gt;&lt;P&gt;Ord(Left(Lower(Description),1))*1e6+Ord(Mid(Lower(Description),2,1))*1e3+Ord(Mid(Lower(Description),3,1))&lt;/P&gt;&lt;P&gt;At least to sort by the fist 3 letters.&lt;/P&gt;&lt;P&gt;Another option can be:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Num((Ord(Left(Lower(Description),1))-96),'00')
 &amp;amp;Num((Ord(Mid(Lower(Description),2,1))-96),'00')
 &amp;amp;Num((Ord(Mid(Lower(Description),3,1))-96),'00')
 ...&lt;/LI-CODE&gt;&lt;P&gt;But it will be better if you can add another field to each description that sets the order of the Descriptions, something Like:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Left Join(DataTable)
LOAD Distinct Description,
	RecNo() as DescriptionOrder
Resident DataTable
Order By Description;&lt;/LI-CODE&gt;&lt;P&gt;So you can use Min({1} DescriptionOrder) to sort values&lt;/P&gt;</description>
    <pubDate>Sat, 20 Feb 2021 09:52:25 GMT</pubDate>
    <dc:creator>rubenmarin</dc:creator>
    <dc:date>2021-02-20T09:52:25Z</dc:date>
    <item>
      <title>Listbox sorting by expression not working</title>
      <link>https://community.qlik.com/t5/QlikView/Listbox-sorting-by-expression-not-working/m-p/1783571#M1209775</link>
      <description>&lt;P&gt;I've been struggling with listbox sorting for a couple of days. I hope someone can assist. My listbox has a field and 2 expressions. I am not able to get it to sort by Description (1st expression). I am able to sort by Sales (2nd expression). I have also tried doing the sort in the load script but that has not helped either. See screenshot of all 3 tests. Attached is my qvw. I am using QV 12.4 SR3.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="VivenReddy_0-1613592745933.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/49295iF8B179EB24C0551F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="VivenReddy_0-1613592745933.png" alt="VivenReddy_0-1613592745933.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2021 20:20:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Listbox-sorting-by-expression-not-working/m-p/1783571#M1209775</guid>
      <dc:creator>VivenReddy</dc:creator>
      <dc:date>2021-02-17T20:20:36Z</dc:date>
    </item>
    <item>
      <title>Re: Listbox sorting by expression not working</title>
      <link>https://community.qlik.com/t5/QlikView/Listbox-sorting-by-expression-not-working/m-p/1784383#M1209858</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/62450"&gt;@VivenReddy&lt;/a&gt;, sort by expression expects a number to sort, you can try with:&lt;/P&gt;&lt;P&gt;Ord(Left(Lower(Description),1))*1e6+Ord(Mid(Lower(Description),2,1))*1e3+Ord(Mid(Lower(Description),3,1))&lt;/P&gt;&lt;P&gt;At least to sort by the fist 3 letters.&lt;/P&gt;&lt;P&gt;Another option can be:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Num((Ord(Left(Lower(Description),1))-96),'00')
 &amp;amp;Num((Ord(Mid(Lower(Description),2,1))-96),'00')
 &amp;amp;Num((Ord(Mid(Lower(Description),3,1))-96),'00')
 ...&lt;/LI-CODE&gt;&lt;P&gt;But it will be better if you can add another field to each description that sets the order of the Descriptions, something Like:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Left Join(DataTable)
LOAD Distinct Description,
	RecNo() as DescriptionOrder
Resident DataTable
Order By Description;&lt;/LI-CODE&gt;&lt;P&gt;So you can use Min({1} DescriptionOrder) to sort values&lt;/P&gt;</description>
      <pubDate>Sat, 20 Feb 2021 09:52:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Listbox-sorting-by-expression-not-working/m-p/1784383#M1209858</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2021-02-20T09:52:25Z</dc:date>
    </item>
    <item>
      <title>Re: Listbox sorting by expression not working</title>
      <link>https://community.qlik.com/t5/QlikView/Listbox-sorting-by-expression-not-working/m-p/1786335#M1210086</link>
      <description>&lt;P&gt;Thank you for your response Ruben.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2021 19:27:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Listbox-sorting-by-expression-not-working/m-p/1786335#M1210086</guid>
      <dc:creator>VivenReddy</dc:creator>
      <dc:date>2021-02-25T19:27:36Z</dc:date>
    </item>
  </channel>
</rss>

