<?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: Custom Sorting in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Custom-Sorting/m-p/2532650#M108122</link>
    <description>&lt;P&gt;Hi, if I load those values on QV, the default sort for numbers (using text sort) is the one you expect.&lt;/P&gt;&lt;P&gt;You can also try this expression:&lt;/P&gt;&lt;P&gt;Alt(Num(SubField(&lt;EM&gt;FieldName&lt;/EM&gt;,'-',1)),99999)&lt;/P&gt;&lt;P&gt;But the last 3 values don't follow any order, as a trick you can add an inline table before the values are loaded, in example:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SortValues:
LOAD * Inline [
FieldName
Not Ranked - TSA
Not Ranked - PIB
Unallocated
];&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;The you can sort by expression and the by load order, as this 3 bvalues will have 9999 as sort, the will use the load value, and the inline table will give the sort order of those values.&lt;/P&gt;&lt;P&gt;After loading all values use a "DROP Table SortValues"&lt;/P&gt;</description>
    <pubDate>Mon, 06 Oct 2025 18:34:50 GMT</pubDate>
    <dc:creator>rubenmarin</dc:creator>
    <dc:date>2025-10-06T18:34:50Z</dc:date>
    <item>
      <title>Custom Sorting</title>
      <link>https://community.qlik.com/t5/App-Development/Custom-Sorting/m-p/2532635#M108120</link>
      <description>&lt;P&gt;Hi all, I am trying to do custom sorting. I have a Master Dimension that have values like:&lt;BR /&gt;1 - flp,e2e&lt;BR /&gt;10 - Prod&amp;amp;Dev E2E&lt;BR /&gt;2 - T41&lt;BR /&gt;4 - Security&lt;BR /&gt;121 - DataIntegrity&lt;BR /&gt;123 - Improvement&lt;BR /&gt;Not Ranked - TSA&lt;BR /&gt;Not Ranked - PIB&lt;BR /&gt;Unallocated&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;and many more in this format&lt;BR /&gt;&lt;BR /&gt;I am trying to sort by this dimension in a straight table, so that it will take the beginning number to sort&lt;BR /&gt;the required sort will be in the below format:&lt;BR /&gt;1 - flp,e2e&lt;BR /&gt;2 - T41&lt;BR /&gt;4 - Security&lt;BR /&gt;10 - Prod&amp;amp;Dev E2E&lt;BR /&gt;121 - DataIntegrity&lt;BR /&gt;123 - Improvement&lt;BR /&gt;Not Ranked - TSA&lt;BR /&gt;Not Ranked - PIB&lt;BR /&gt;Unallocated&lt;BR /&gt;&lt;BR /&gt;When I am using sorting numerically, its not working&lt;BR /&gt;and when i use alphabetical sort, its giving result like below:&lt;BR /&gt;1 - flp,e2e&lt;BR /&gt;10 - Prod&amp;amp;Dev E2E&lt;BR /&gt;121 - DataIntegrity&lt;BR /&gt;123 - Improvement&lt;BR /&gt;2 - T41&lt;BR /&gt;4 - Security&lt;BR /&gt;Not Ranked - TSA&lt;BR /&gt;Not Ranked - PIB&lt;BR /&gt;Unallocated&lt;BR /&gt;&lt;BR /&gt;Please help me resolve this so that I can sort based on the starting numbers before '-'&lt;BR /&gt;Thank You!&lt;/P&gt;</description>
      <pubDate>Mon, 06 Oct 2025 15:57:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Custom-Sorting/m-p/2532635#M108120</guid>
      <dc:creator>vaka</dc:creator>
      <dc:date>2025-10-06T15:57:16Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Sorting</title>
      <link>https://community.qlik.com/t5/App-Development/Custom-Sorting/m-p/2532650#M108122</link>
      <description>&lt;P&gt;Hi, if I load those values on QV, the default sort for numbers (using text sort) is the one you expect.&lt;/P&gt;&lt;P&gt;You can also try this expression:&lt;/P&gt;&lt;P&gt;Alt(Num(SubField(&lt;EM&gt;FieldName&lt;/EM&gt;,'-',1)),99999)&lt;/P&gt;&lt;P&gt;But the last 3 values don't follow any order, as a trick you can add an inline table before the values are loaded, in example:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SortValues:
LOAD * Inline [
FieldName
Not Ranked - TSA
Not Ranked - PIB
Unallocated
];&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;The you can sort by expression and the by load order, as this 3 bvalues will have 9999 as sort, the will use the load value, and the inline table will give the sort order of those values.&lt;/P&gt;&lt;P&gt;After loading all values use a "DROP Table SortValues"&lt;/P&gt;</description>
      <pubDate>Mon, 06 Oct 2025 18:34:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Custom-Sorting/m-p/2532650#M108122</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2025-10-06T18:34:50Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Sorting</title>
      <link>https://community.qlik.com/t5/App-Development/Custom-Sorting/m-p/2532707#M108134</link>
      <description>&lt;P&gt;Another solution could be to make a dual out of your Field. Building on&amp;nbsp;&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/22593"&gt;@rubenmarin&lt;/a&gt;&amp;nbsp;'s alt(...) function.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Declare the FieldName like this &lt;EM&gt;in the script&lt;/EM&gt;. Make sure that the constant (in this case 1000) is higher than any of the ids&amp;nbsp; found on the field values (in your example the highest id is 123)&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;dual(
   [FieldName],
   alt(num( SubField([FieldName],'-',1)), 1000+ AutoNumber([FieldName]))
) as [FieldName]&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 07 Oct 2025 08:27:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Custom-Sorting/m-p/2532707#M108134</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2025-10-07T08:27:50Z</dc:date>
    </item>
  </channel>
</rss>

