<?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: Sort order first on ... then on ... in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Sort-order-first-on-then-on/m-p/1006552#M528480</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;I'm not totally sure what was your question here... I assume you want to improve your sorting expression or find a mroe elegant one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I'd suggest is calculating a "composite" sorting value based on the three conditions that you listed. Since all of your values range from 1 to 4, it's quite easy to build a 3-digit number, where each digit is responsible for a certain condition. Something like this:&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;[Current level] * 100 +&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="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;([Target level short term]-[Current level]) * 10 + &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="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;([Target level long term]-[Target level short term]) * 1&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="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&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;if I got your logic correctly...&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;cheers,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Oleg Troyansky&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;A href="http://www.amazon.com/gp/product/1118949552/ref=as_li_tl?ie=UTF8&amp;amp;camp=1789&amp;amp;creative=9325&amp;amp;creativeASIN=1118949552&amp;amp;linkCode=as2&amp;amp;tag=natursyner0f-20&amp;amp;linkId=HEF4KYLLE22XIQH2"&gt;QlikView Your Business: An expert guide to Business Discovery with QlikView and Qlik Sense&lt;/A&gt;&lt;IMG alt="" border="0" height="1" src="http://ir-na.amazon-adsystem.com/e/ir?t=natursyner0f-20&amp;amp;l=as2&amp;amp;o=1&amp;amp;a=1118949552" style="border: none !important; margin: 0px !important;" width="1" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 09 Sep 2015 16:51:50 GMT</pubDate>
    <dc:creator>Oleg_Troyansky</dc:creator>
    <dc:date>2015-09-09T16:51:50Z</dc:date>
    <item>
      <title>Sort order first on ... then on ...</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-order-first-on-then-on/m-p/1006551#M528479</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;I have a bar chart which shows the development of skills per employee. Some explanation: Employees get a skill rating between 1 and 4 for a current, short term and long term level. The bar chart shows the growth of the employee over time. It's a stacked bar chart with three expressions:&lt;/P&gt;&lt;P&gt;1. current level&lt;/P&gt;&lt;P&gt;2. short term level - current level&lt;/P&gt;&lt;P&gt;3. long term level - short term level&lt;/P&gt;&lt;P&gt;See picture below (ST = short term LT= Long term)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/98420_pastedImage_0.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;I want to sort the bar chart in this manner:&lt;/P&gt;&lt;P&gt;first on current level&lt;/P&gt;&lt;P&gt;then on growth short term&lt;/P&gt;&lt;P&gt;then on growth long term&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first bars should only show people who don't have to learn.&lt;/P&gt;&lt;P&gt;the next bars should show people who only have to learn on a short term&lt;/P&gt;&lt;P&gt;then the&amp;nbsp; bars should show people who have to learn on the short term and long term&lt;/P&gt;&lt;P&gt;then the bars should show people who only have to learn on the long term.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To make more complicated (and more readable) the current level is leading, first the growth of all the current 1, then current 2, etc..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've some sort expressions but i can't get it to work. It should look like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/98421_pastedImage_1.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;This one happens to be correct, no idea why.&lt;/P&gt;&lt;P&gt;My current sort expression is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[Current level]&amp;amp;IF(([Target level long term]-[Target level short term])=0,([Target level short term]-[Current level]),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF(([Target level long term]-[Target level short term])=([Target level short term]-[Current level]), [Target level short term],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF(([Target level long term]-[Target level short term])&amp;gt;([Target level short term]-[Current level]), [Target level long term])))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Sep 2015 16:25:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-order-first-on-then-on/m-p/1006551#M528479</guid>
      <dc:creator />
      <dc:date>2015-09-09T16:25:30Z</dc:date>
    </item>
    <item>
      <title>Re: Sort order first on ... then on ...</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-order-first-on-then-on/m-p/1006552#M528480</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;I'm not totally sure what was your question here... I assume you want to improve your sorting expression or find a mroe elegant one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I'd suggest is calculating a "composite" sorting value based on the three conditions that you listed. Since all of your values range from 1 to 4, it's quite easy to build a 3-digit number, where each digit is responsible for a certain condition. Something like this:&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;[Current level] * 100 +&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="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;([Target level short term]-[Current level]) * 10 + &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="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;([Target level long term]-[Target level short term]) * 1&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="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&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;if I got your logic correctly...&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;cheers,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Oleg Troyansky&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;A href="http://www.amazon.com/gp/product/1118949552/ref=as_li_tl?ie=UTF8&amp;amp;camp=1789&amp;amp;creative=9325&amp;amp;creativeASIN=1118949552&amp;amp;linkCode=as2&amp;amp;tag=natursyner0f-20&amp;amp;linkId=HEF4KYLLE22XIQH2"&gt;QlikView Your Business: An expert guide to Business Discovery with QlikView and Qlik Sense&lt;/A&gt;&lt;IMG alt="" border="0" height="1" src="http://ir-na.amazon-adsystem.com/e/ir?t=natursyner0f-20&amp;amp;l=as2&amp;amp;o=1&amp;amp;a=1118949552" style="border: none !important; margin: 0px !important;" width="1" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Sep 2015 16:51:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-order-first-on-then-on/m-p/1006552#M528480</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2015-09-09T16:51:50Z</dc:date>
    </item>
    <item>
      <title>Re: Sort order first on ... then on ...</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-order-first-on-then-on/m-p/1006553#M528481</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tried something like this before but somehow it doesn't quite do the job, sometimes it orders perfect, sometimes a weird high value comes in between.. i'll keep on searching but thanks for the reply!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;example of weird value:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/98455_pastedImage_0.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;one that does order correctly (could be luck &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/wink.png" /&gt; &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/98459_pastedImage_1.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Sep 2015 21:33:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-order-first-on-then-on/m-p/1006553#M528481</guid>
      <dc:creator />
      <dc:date>2015-09-09T21:33:42Z</dc:date>
    </item>
  </channel>
</rss>

