<?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: List box sorting in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/List-box-sorting/m-p/1254525#M855376</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Under sort options use expression. Convert your QN yyyy format into yyyyqn and it should work. Other crude option is to use if condition in the sort expression. If ( variable= q1, 1, if q2 , 2 .... It's multiple nested if option in case you are unable to convert the data in sortable way. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Feb 2017 17:48:00 GMT</pubDate>
    <dc:creator />
    <dc:date>2017-02-10T17:48:00Z</dc:date>
    <item>
      <title>List box sorting</title>
      <link>https://community.qlik.com/t5/QlikView/List-box-sorting/m-p/1254521#M855372</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How can I sort the below by the latest quearter? For this instance the latest quarter is Q1 2017. I tried all the sorting options and none give me the results I want.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/152804_pastedImage_0.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/List-box-sorting/m-p/1254521#M855372</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: List box sorting</title>
      <link>https://community.qlik.com/t5/QlikView/List-box-sorting/m-p/1254522#M855373</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;is it a dual() value?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Feb 2017 17:38:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/List-box-sorting/m-p/1254522#M855373</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-02-10T17:38:41Z</dc:date>
    </item>
    <item>
      <title>Re: List box sorting</title>
      <link>https://community.qlik.com/t5/QlikView/List-box-sorting/m-p/1254523#M855374</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Had to look up dual value. No this is not a dual value. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Feb 2017 17:40:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/List-box-sorting/m-p/1254523#M855374</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-02-10T17:40:50Z</dc:date>
    </item>
    <item>
      <title>Re: List box sorting</title>
      <link>https://community.qlik.com/t5/QlikView/List-box-sorting/m-p/1254524#M855375</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;dual(yourquarterfield,&lt;SPAN class="script_token"&gt;MakeDate(&lt;/SPAN&gt;&lt;SPAN class="bnf_token"&gt;right(yourquarterfield,4),4*&lt;SPAN class="bnf_token"&gt;mid(yourquarterfield,2,1)) as yourquarterfield,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="bnf_token"&gt;&lt;SPAN class="bnf_token"&gt;...&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="bnf_token"&gt;&lt;SPAN class="bnf_token"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="bnf_token"&gt;&lt;SPAN class="bnf_token"&gt;--&amp;gt; then sort your listbox by number&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Feb 2017 17:45:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/List-box-sorting/m-p/1254524#M855375</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-02-10T17:45:44Z</dc:date>
    </item>
    <item>
      <title>Re: List box sorting</title>
      <link>https://community.qlik.com/t5/QlikView/List-box-sorting/m-p/1254525#M855376</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Under sort options use expression. Convert your QN yyyy format into yyyyqn and it should work. Other crude option is to use if condition in the sort expression. If ( variable= q1, 1, if q2 , 2 .... It's multiple nested if option in case you are unable to convert the data in sortable way. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Feb 2017 17:48:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/List-box-sorting/m-p/1254525#M855376</guid>
      <dc:creator />
      <dc:date>2017-02-10T17:48:00Z</dc:date>
    </item>
    <item>
      <title>Re: List box sorting</title>
      <link>https://community.qlik.com/t5/QlikView/List-box-sorting/m-p/1254526#M855377</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;On the sort tab.&amp;nbsp; In the Sort by Expression, you could do this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=right(yourfield,4) &amp;amp; ' '&amp;amp; mid(yourfield,2,1)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Feb 2017 17:48:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/List-box-sorting/m-p/1254526#M855377</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-02-10T17:48:47Z</dc:date>
    </item>
    <item>
      <title>Re: List box sorting</title>
      <link>https://community.qlik.com/t5/QlikView/List-box-sorting/m-p/1254527#M855378</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, updated code below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;dual&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;CALENDAR_QUARTER&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;MakeDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;right&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;CALENDAR_QUARTER&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,4),4*&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;mid&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;CALENDAR_QUARTER&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,2,1))) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Feb 2017 17:51:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/List-box-sorting/m-p/1254527#M855378</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-02-10T17:51:26Z</dc:date>
    </item>
    <item>
      <title>Re: List box sorting</title>
      <link>https://community.qlik.com/t5/QlikView/List-box-sorting/m-p/1254528#M855379</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This works perfectly! Could you explain what it's doing? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Feb 2017 17:54:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/List-box-sorting/m-p/1254528#M855379</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-02-10T17:54:02Z</dc:date>
    </item>
    <item>
      <title>Re: List box sorting</title>
      <link>https://community.qlik.com/t5/QlikView/List-box-sorting/m-p/1254529#M855380</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;does it work?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Feb 2017 17:54:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/List-box-sorting/m-p/1254529#M855380</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-02-10T17:54:07Z</dc:date>
    </item>
    <item>
      <title>Re: List box sorting</title>
      <link>https://community.qlik.com/t5/QlikView/List-box-sorting/m-p/1254530#M855381</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's taking the year number, that's this part:&amp;nbsp; right(F1,4)&amp;nbsp; and the quarter number, that's this part &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;mid(yourfield,2,1)&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;So the entire formula would take this: "Q4 2014" and give you this "2014 4".&lt;/P&gt;&lt;P&gt;And it would do it for all your values.&lt;/P&gt;&lt;P&gt;Sorting that gives you the order you're looking for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Really, you should probably just have another column in your data model that is easily sortable for this.&amp;nbsp; Like a month or day column in your calendar.&amp;nbsp; And put that in the sort expression.&lt;/P&gt;&lt;P&gt;But what I gave you works in a pinch.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Feb 2017 17:59:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/List-box-sorting/m-p/1254530#M855381</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-02-10T17:59:28Z</dc:date>
    </item>
    <item>
      <title>Re: List box sorting</title>
      <link>https://community.qlik.com/t5/QlikView/List-box-sorting/m-p/1254531#M855382</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I see. So I do have calendar date in my table. I didn't realize I could sort in my expression based on other columns.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This works:&lt;/P&gt;&lt;P&gt;=Calendar_Date&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Feb 2017 18:04:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/List-box-sorting/m-p/1254531#M855382</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-02-10T18:04:26Z</dc:date>
    </item>
    <item>
      <title>Re: List box sorting</title>
      <link>https://community.qlik.com/t5/QlikView/List-box-sorting/m-p/1254532#M855384</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;that's why I asked for dual()...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Feb 2017 18:06:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/List-box-sorting/m-p/1254532#M855384</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-02-10T18:06:05Z</dc:date>
    </item>
    <item>
      <title>Re: List box sorting</title>
      <link>https://community.qlik.com/t5/QlikView/List-box-sorting/m-p/1254533#M855386</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yup!&amp;nbsp; That's the easier way.&amp;nbsp; Glad we were able to get you there.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Feb 2017 18:06:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/List-box-sorting/m-p/1254533#M855386</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-02-10T18:06:40Z</dc:date>
    </item>
    <item>
      <title>Re: List box sorting</title>
      <link>https://community.qlik.com/t5/QlikView/List-box-sorting/m-p/1254534#M855389</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;jsut load as dual and forget about sorting expressions, instead sort numerically:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="QlikCommunity_Thread_249500_Pic1.JPG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/152827_QlikCommunity_Thread_249500_Pic1.JPG" style="height: auto; width: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="QlikCommunity_Thread_249500_Pic2.JPG" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/152828_QlikCommunity_Thread_249500_Pic2.JPG" style="height: auto; width: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="QlikCommunity_Thread_249500_Pic3.JPG" class="jive-image image-3" src="https://community.qlik.com/legacyfs/online/152829_QlikCommunity_Thread_249500_Pic3.JPG" style="height: auto; width: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;an example using the already suggested Dual() function with a small correction of the month part to deliver correct dates:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14867687151642032 jive_text_macro" jivemacro_uid="_14867687151642032"&gt;
&lt;P&gt;LOAD Dual(Quarter,MakeDate(Mid(Quarter,4),Mid(Quarter,2,1)*3-2)) as Quarter&lt;/P&gt;
&lt;P&gt;INLINE [&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Quarter&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Q1 2013&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Q2 2013&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Q3 2013&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Q4 2013&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Q1 2014&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Q2 2014&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Q3 2014&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Q4 2014&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Q1 2015&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Q2 2015&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Q3 2015&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Q4 2015&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Q1 2016&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Q2 2016&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Q3 2016&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Q4 2016&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Q1 2017&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Q2 2017&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Q3 2017&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Q4 2017&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Feb 2017 23:19:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/List-box-sorting/m-p/1254534#M855389</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2017-02-10T23:19:05Z</dc:date>
    </item>
  </channel>
</rss>

