<?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: Order list box items using an expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Order-list-box-items-using-an-expression/m-p/1185855#M383727</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;see attach&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 15 Sep 2016 14:49:55 GMT</pubDate>
    <dc:creator>florentina_doga</dc:creator>
    <dc:date>2016-09-15T14:49:55Z</dc:date>
    <item>
      <title>Order list box items using an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Order-list-box-items-using-an-expression/m-p/1185853#M383725</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a list box with some values, let's say:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Car&lt;/P&gt;&lt;P&gt;Bus&lt;/P&gt;&lt;P&gt;Metro&lt;/P&gt;&lt;P&gt;Airplane&lt;/P&gt;&lt;P&gt;Train&lt;/P&gt;&lt;P&gt;Helicopter&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;List box was populated from a table field that was loaded from an excel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to order them in order to be displayed as below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Train&lt;/P&gt;&lt;P&gt;Metro&lt;/P&gt;&lt;P&gt;Car&lt;/P&gt;&lt;P&gt;Bus&lt;/P&gt;&lt;P&gt;Helicopter&lt;/P&gt;&lt;P&gt;Airplane&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but I want to order them using an expression in the list box order tab. How can I do this? I do not want to order them in the script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, If I want to put an element always at the end, for example, put Metro item always at the end of the list, how can I do this as well?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;I have not explained so well so I am explaining it in details. I would like to use dual expression. Suppose I have more items than above indicated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my script I load the information from excel as below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; name,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; description,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cost,&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp; if(trim(name)='Train' or &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt; trim(name)='Metro' or &lt;SPAN style="font-size: 13.3333px;"&gt;trim(name)='Car' or &lt;SPAN style="font-size: 13.3333px;"&gt;trim(name)='Bus' or &lt;SPAN style="font-size: 13.3333px;"&gt;trim(name)='Helicopter',&amp;nbsp; name, "Show More Values\' &amp;amp; name) as name_extended, &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(trim(name)='Train', 1, &lt;SPAN style="font-size: 13.3333px;"&gt; if(trim(name)='Metro', 2, &lt;SPAN style="font-size: 13.3333px;"&gt; if(trim(name)='Car', 3, &lt;SPAN style="font-size: 13.3333px;"&gt; if(trim(name)='Bus', 4, &lt;SPAN style="font-size: 13.3333px;"&gt; if(trim(name)='Helicopter', 5, 6))))) as order&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;FROM&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; [myexcel.xlsx]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I assign a corrleative number for the more used ones 1 to 5 and I assign 6 to the rest.&lt;/P&gt;&lt;P&gt;So with this I show the most used first and the rest collapsed. I enable tree view in the list box and caracter separator '\'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then in the order tab list box I use below expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=dual([name_extended], order) and I select ascendent, but it is not working. I want item order in this sequence: 1, 2, 3, 4, 5 and then the rest of items marked with 6.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Sep 2016 14:40:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Order-list-box-items-using-an-expression/m-p/1185853#M383725</guid>
      <dc:creator />
      <dc:date>2016-09-15T14:40:11Z</dc:date>
    </item>
    <item>
      <title>Re: Order list box items using an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Order-list-box-items-using-an-expression/m-p/1185854#M383726</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 can use belwo expression in Sort tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Match&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Field_Name&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,'T&lt;/SPAN&gt;rain','Metro','Car','Bus','Helicopter','Airplane')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Sep 2016 14:43:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Order-list-box-items-using-an-expression/m-p/1185854#M383726</guid>
      <dc:creator>krishnacbe</dc:creator>
      <dc:date>2016-09-15T14:43:01Z</dc:date>
    </item>
    <item>
      <title>Re: Order list box items using an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Order-list-box-items-using-an-expression/m-p/1185855#M383727</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;see attach&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Sep 2016 14:49:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Order-list-box-items-using-an-expression/m-p/1185855#M383727</guid>
      <dc:creator>florentina_doga</dc:creator>
      <dc:date>2016-09-15T14:49:55Z</dc:date>
    </item>
    <item>
      <title>Re: Order list box items using an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Order-list-box-items-using-an-expression/m-p/1185856#M383728</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;use dual in sort&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Sep 2016 14:50:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Order-list-box-items-using-an-expression/m-p/1185856#M383728</guid>
      <dc:creator>florentina_doga</dc:creator>
      <dc:date>2016-09-15T14:50:35Z</dc:date>
    </item>
    <item>
      <title>Re: Order list box items using an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Order-list-box-items-using-an-expression/m-p/1185857#M383729</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;I like your solution so I have tried to do it. I have edit my post as I have not explained so well. I have explained in details. But your solution is not working for me. Please, see my edit below '-----------'.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Sep 2016 15:33:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Order-list-box-items-using-an-expression/m-p/1185857#M383729</guid>
      <dc:creator />
      <dc:date>2016-09-15T15:33:13Z</dc:date>
    </item>
    <item>
      <title>Re: Order list box items using an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Order-list-box-items-using-an-expression/m-p/1185858#M383730</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your solution does not work in my case and I do not know why. Your example work great! The only difference between your example and my case is that you use an inline table and I create the table in my script loading it from an excel:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LOAD&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; name,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; description,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cost,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp; if(trim(name)='Train' or &lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;trim(name)='Metro' or &lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;trim(name)='Car' or &lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;trim(name)='Bus' or&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;trim(name)='Helicopter',&amp;nbsp; name, "Show More Values\' &amp;amp; name) as name_extended,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(trim(name)='Train', 1, &lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;if(trim(name)='Metro', 2, &lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;if(trim(name)='Car', 3, &lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;if(trim(name)='Bus', 4,&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;if(trim(name)='Helicopter', 5, 6))))) as order&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;FROM&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp; [myexcel.xlsx]&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Please, see my post edited after line "------------------". Why in my case is not working? In my case "Show more values" item is always put in the first position despite ordering desc or asc. What's the problem?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Sep 2016 08:00:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Order-list-box-items-using-an-expression/m-p/1185858#M383730</guid>
      <dc:creator />
      <dc:date>2016-09-16T08:00:36Z</dc:date>
    </item>
  </channel>
</rss>

