<?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 List Box sorting based on Expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/List-Box-sorting-based-on-Expression/m-p/466908#M565159</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="text-align: left; color: #333333; text-indent: 0px;"&gt;Hi everybody,&lt;/P&gt;&lt;P style="text-align: left; color: #333333; text-indent: 0px;"&gt;i have a list box containing the Months. I need to sort this list box so that list begins with "Jul". I did this with a sort expression :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code  _jivemacro_uid_1359452379737766" jivemacro_uid="_1359452379737766"&gt;&lt;P&gt;= MOD( ( Calendar.Month + 5 ) , 12 ) + 1&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: left; color: #333333; text-indent: 0px;"&gt;&lt;IMG __jive_id="32726" class="jive-image" alt="1.JPG" src="https://community.qlik.com/legacyfs/online/32726_1.JPG" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: left; color: #333333; text-indent: 0px;"&gt;Works good! But as soon as i select one or more months, i get this result :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: left; color: #333333; text-indent: 0px;"&gt;&lt;IMG __jive_id="32728" class="jive-image" alt="2.JPG" src="https://community.qlik.com/legacyfs/online/32728_2.JPG" /&gt;&lt;/P&gt;&lt;P style="text-align: left; color: #333333; text-indent: 0px;"&gt;I understand because of my selection, the "Calendar.Month" is NULL for all nonselected Months and therefor QV can not calculate the expression.&lt;/P&gt;&lt;P style="text-align: left; color: #333333; text-indent: 0px;"&gt;But i need the result as is shown below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: left; color: #333333; text-indent: 0px;"&gt;&lt;IMG __jive_id="32729" class="jive-image" alt="3.JPG" src="https://community.qlik.com/legacyfs/online/32729_3.JPG" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: left; color: #333333; text-indent: 0px;"&gt;It's like the way QV shows the List Box when i select "Numeric Value" as Sort order:&lt;/P&gt;&lt;P style="text-align: left; color: #333333; text-indent: 0px;"&gt;&lt;IMG __jive_id="32730" class="jive-image" alt="4.JPG" src="https://community.qlik.com/legacyfs/online/32730_4.JPG" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: left; color: #333333; text-indent: 0px;"&gt;that means i want to keep the order from my Expression as i select some Months.&lt;/P&gt;&lt;P style="text-align: left; color: #333333; text-indent: 0px;"&gt;I appreciate any idea.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: left; color: #333333; text-indent: 0px;"&gt;Best regards - Peyman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 29 Jan 2013 10:14:41 GMT</pubDate>
    <dc:creator>azimabadi</dc:creator>
    <dc:date>2013-01-29T10:14:41Z</dc:date>
    <item>
      <title>List Box sorting based on Expression</title>
      <link>https://community.qlik.com/t5/QlikView/List-Box-sorting-based-on-Expression/m-p/466908#M565159</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="text-align: left; color: #333333; text-indent: 0px;"&gt;Hi everybody,&lt;/P&gt;&lt;P style="text-align: left; color: #333333; text-indent: 0px;"&gt;i have a list box containing the Months. I need to sort this list box so that list begins with "Jul". I did this with a sort expression :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code  _jivemacro_uid_1359452379737766" jivemacro_uid="_1359452379737766"&gt;&lt;P&gt;= MOD( ( Calendar.Month + 5 ) , 12 ) + 1&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: left; color: #333333; text-indent: 0px;"&gt;&lt;IMG __jive_id="32726" class="jive-image" alt="1.JPG" src="https://community.qlik.com/legacyfs/online/32726_1.JPG" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: left; color: #333333; text-indent: 0px;"&gt;Works good! But as soon as i select one or more months, i get this result :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: left; color: #333333; text-indent: 0px;"&gt;&lt;IMG __jive_id="32728" class="jive-image" alt="2.JPG" src="https://community.qlik.com/legacyfs/online/32728_2.JPG" /&gt;&lt;/P&gt;&lt;P style="text-align: left; color: #333333; text-indent: 0px;"&gt;I understand because of my selection, the "Calendar.Month" is NULL for all nonselected Months and therefor QV can not calculate the expression.&lt;/P&gt;&lt;P style="text-align: left; color: #333333; text-indent: 0px;"&gt;But i need the result as is shown below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: left; color: #333333; text-indent: 0px;"&gt;&lt;IMG __jive_id="32729" class="jive-image" alt="3.JPG" src="https://community.qlik.com/legacyfs/online/32729_3.JPG" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: left; color: #333333; text-indent: 0px;"&gt;It's like the way QV shows the List Box when i select "Numeric Value" as Sort order:&lt;/P&gt;&lt;P style="text-align: left; color: #333333; text-indent: 0px;"&gt;&lt;IMG __jive_id="32730" class="jive-image" alt="4.JPG" src="https://community.qlik.com/legacyfs/online/32730_4.JPG" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: left; color: #333333; text-indent: 0px;"&gt;that means i want to keep the order from my Expression as i select some Months.&lt;/P&gt;&lt;P style="text-align: left; color: #333333; text-indent: 0px;"&gt;I appreciate any idea.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: left; color: #333333; text-indent: 0px;"&gt;Best regards - Peyman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jan 2013 10:14:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/List-Box-sorting-based-on-Expression/m-p/466908#M565159</guid>
      <dc:creator>azimabadi</dc:creator>
      <dc:date>2013-01-29T10:14:41Z</dc:date>
    </item>
    <item>
      <title>Re: List Box sorting based on Expression</title>
      <link>https://community.qlik.com/t5/QlikView/List-Box-sorting-based-on-Expression/m-p/466909#M565160</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have to tell QlikView that the expression should be calculated on the full model instead on only on the selection. This is done with the set analysis expression {1}. I think it should be something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class="jive-code"&gt;= MOD( ( Only({1} Calendar.Month) + 5 ) , 12 ) + 1&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;JG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jan 2013 10:33:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/List-Box-sorting-based-on-Expression/m-p/466909#M565160</guid>
      <dc:creator />
      <dc:date>2013-01-29T10:33:00Z</dc:date>
    </item>
    <item>
      <title>Re: List Box sorting based on Expression</title>
      <link>https://community.qlik.com/t5/QlikView/List-Box-sorting-based-on-Expression/m-p/466910#M565161</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is an example, hope it helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jan 2013 10:38:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/List-Box-sorting-based-on-Expression/m-p/466910#M565161</guid>
      <dc:creator>alexandros17</dc:creator>
      <dc:date>2013-01-29T10:38:31Z</dc:date>
    </item>
    <item>
      <title>Re: List Box sorting based on Expression</title>
      <link>https://community.qlik.com/t5/QlikView/List-Box-sorting-based-on-Expression/m-p/466911#M565162</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Peyman,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can calculate the position of the month in the script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then in the List Box, your expression will be Sum({1} DISTINCT Calendar.MonthOrder) and then, even if you select a month, the order will be show for all months.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nicolas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jan 2013 10:42:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/List-Box-sorting-based-on-Expression/m-p/466911#M565162</guid>
      <dc:creator />
      <dc:date>2013-01-29T10:42:25Z</dc:date>
    </item>
    <item>
      <title>Re: List Box sorting based on Expression</title>
      <link>https://community.qlik.com/t5/QlikView/List-Box-sorting-based-on-Expression/m-p/466912#M565163</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Based on the alexandros17 sample, I have adapted the expressions with the &lt;SPAN style="color: #737373; font-family: monospace; font-size: 16px; background-color: #ffffff;"&gt;MOD( ( Only({1} order) + 5 ) , 12 ) + 1&lt;/SPAN&gt; formula:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;JG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jan 2013 10:47:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/List-Box-sorting-based-on-Expression/m-p/466912#M565163</guid>
      <dc:creator />
      <dc:date>2013-01-29T10:47:07Z</dc:date>
    </item>
    <item>
      <title>Re: List Box sorting based on Expression</title>
      <link>https://community.qlik.com/t5/QlikView/List-Box-sorting-based-on-Expression/m-p/466913#M565164</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;Nicolas&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;in this case i need to change begining Month dynamicly on interface, user can select the begining month and i have to calculate some expressions based on this selected begining Month. That is why i can't calculate a new order in my script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you so much&lt;/P&gt;&lt;P&gt;Peyman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jan 2013 11:04:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/List-Box-sorting-based-on-Expression/m-p/466913#M565164</guid>
      <dc:creator>azimabadi</dc:creator>
      <dc:date>2013-01-29T11:04:53Z</dc:date>
    </item>
    <item>
      <title>Re: List Box sorting based on Expression</title>
      <link>https://community.qlik.com/t5/QlikView/List-Box-sorting-based-on-Expression/m-p/466914#M565165</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thx so much JG,&lt;/P&gt;&lt;P&gt;i'm surpreised how i forget everytime set analysis!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Peyman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jan 2013 11:06:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/List-Box-sorting-based-on-Expression/m-p/466914#M565165</guid>
      <dc:creator>azimabadi</dc:creator>
      <dc:date>2013-01-29T11:06:31Z</dc:date>
    </item>
  </channel>
</rss>

