<?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 expression not working in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Sort-expression-not-working/m-p/1633686#M732301</link>
    <description>&lt;P&gt;Each invalid expression respectively with invalid results will be ignored. In your case the issue is caused through your trial to apply the sorting on your calculated dimension - this couldn't work.&lt;/P&gt;&lt;P&gt;But using just: avg(AverageBalance) should work. Alternatively you could create your buckets as dual-values, like:&lt;/P&gt;&lt;P&gt;=if(AverageBalance &amp;lt;= 0, dual('Negative', 1),&lt;BR /&gt;if(AverageBalance &amp;gt;= 0 and AverageBalance &amp;lt;= 50, dual('$0-$50', 2),&lt;BR /&gt;if(AverageBalance &amp;gt;= 51 and AverageBalance &amp;lt;= 500, dual('$51-$500', 3),&lt;BR /&gt;if(AverageBalance &amp;gt;= 501 and AverageBalance &amp;lt;= 1000, dual('$501-$1000', 4),&lt;BR /&gt;if(AverageBalance &amp;gt;= 1001 and AverageBalance &amp;lt;= 5000, dual('$1001-$5000', 5),&lt;BR /&gt;if(AverageBalance &amp;gt;= 5001 and AverageBalance &amp;lt;= 10000, dual('$5001-$10000', 6),&lt;BR /&gt;dual('Over $10000', 7)))))))&lt;/P&gt;&lt;P&gt;and then the sorting could be just numeric.&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 10 Oct 2019 13:40:18 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2019-10-10T13:40:18Z</dc:date>
    <item>
      <title>Sort expression not working</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-expression-not-working/m-p/1632703#M732297</link>
      <description>&lt;P&gt;All,&lt;/P&gt;&lt;P&gt;I have a sort expression not working. Nothing I do changes the sort. Attached is a picture of my chart with the properties open and showing the sort expression but I'll explain in detail.&lt;/P&gt;&lt;P&gt;My chart counts how many customers are in the following average monthly balance buckets and here is the dimension:&lt;/P&gt;&lt;P&gt;=if(AverageBalance &amp;lt;= 0, 'Negative',&lt;BR /&gt;if(AverageBalance &amp;gt;= 0 and AverageBalance &amp;lt;= 50, '$0-$50',&lt;BR /&gt;if(AverageBalance &amp;gt;= 51 and AverageBalance &amp;lt;= 500, '$51-$500',&lt;BR /&gt;if(AverageBalance &amp;gt;= 501 and AverageBalance &amp;lt;= 1000, '$501-$1000',&lt;BR /&gt;if(AverageBalance &amp;gt;= 1001 and AverageBalance &amp;lt;= 5000, '$1001-$5000',&lt;BR /&gt;if(AverageBalance &amp;gt;= 5001 and AverageBalance &amp;lt;= 10000, '$5001-$10000',&lt;BR /&gt;'Over $10000'))))))&lt;/P&gt;&lt;P&gt;I need the values/buckets to sort in the above order and here is the sort expression that isn't working:&lt;/P&gt;&lt;P&gt;=match([Avg Balance], 'Negative', '$0-$50', '$51-$500', '$501-$1000', '$1001-$5000', '$5001-$10000', 'Over $10000')&lt;/P&gt;&lt;P&gt;I've tried using the field name (AverageBalance), the label of the dimension (Avg Balance) and many other things but it's not working.&lt;/P&gt;&lt;P&gt;What am I doing wrong?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-expression-not-working/m-p/1632703#M732297</guid>
      <dc:creator>meckeard</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Sort expression not working</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-expression-not-working/m-p/1632778#M732298</link>
      <description>&lt;P&gt;Try this in sort expression:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;pick(match([Avg Balance], 'Negative', '$0-$50', '$51-$500', '$501-$1000', '$1001-$5000', '$5001-$10000', 'Over $10000'),&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1,2,3,4,5,6,7)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2019 00:36:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-expression-not-working/m-p/1632778#M732298</guid>
      <dc:creator>Arthur_Fong</dc:creator>
      <dc:date>2019-10-09T00:36:39Z</dc:date>
    </item>
    <item>
      <title>Re: Sort expression not working</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-expression-not-working/m-p/1633604#M732299</link>
      <description>&lt;P&gt;Hi jkfog93,&lt;/P&gt;&lt;P&gt;Thanks for helping.&lt;/P&gt;&lt;P&gt;That didn't work.&amp;nbsp; In fact, I can put in an invalid field name in place of [Avg Balance] and the sort remains the same.&amp;nbsp; It's almost as if it is completely ignoring any expression I use.&amp;nbsp; The "Expression" checkbox is checked, so I don't know why I can't change the sort order.&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2019 11:30:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-expression-not-working/m-p/1633604#M732299</guid>
      <dc:creator>meckeard</dc:creator>
      <dc:date>2019-10-10T11:30:28Z</dc:date>
    </item>
    <item>
      <title>Re: Sort expression not working</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-expression-not-working/m-p/1633629#M732300</link>
      <description>&lt;P&gt;match should have worked, can you share screenshot of how you are putting it?&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2019 12:30:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-expression-not-working/m-p/1633629#M732300</guid>
      <dc:creator>asinha1991</dc:creator>
      <dc:date>2019-10-10T12:30:03Z</dc:date>
    </item>
    <item>
      <title>Re: Sort expression not working</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-expression-not-working/m-p/1633686#M732301</link>
      <description>&lt;P&gt;Each invalid expression respectively with invalid results will be ignored. In your case the issue is caused through your trial to apply the sorting on your calculated dimension - this couldn't work.&lt;/P&gt;&lt;P&gt;But using just: avg(AverageBalance) should work. Alternatively you could create your buckets as dual-values, like:&lt;/P&gt;&lt;P&gt;=if(AverageBalance &amp;lt;= 0, dual('Negative', 1),&lt;BR /&gt;if(AverageBalance &amp;gt;= 0 and AverageBalance &amp;lt;= 50, dual('$0-$50', 2),&lt;BR /&gt;if(AverageBalance &amp;gt;= 51 and AverageBalance &amp;lt;= 500, dual('$51-$500', 3),&lt;BR /&gt;if(AverageBalance &amp;gt;= 501 and AverageBalance &amp;lt;= 1000, dual('$501-$1000', 4),&lt;BR /&gt;if(AverageBalance &amp;gt;= 1001 and AverageBalance &amp;lt;= 5000, dual('$1001-$5000', 5),&lt;BR /&gt;if(AverageBalance &amp;gt;= 5001 and AverageBalance &amp;lt;= 10000, dual('$5001-$10000', 6),&lt;BR /&gt;dual('Over $10000', 7)))))))&lt;/P&gt;&lt;P&gt;and then the sorting could be just numeric.&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2019 13:40:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-expression-not-working/m-p/1633686#M732301</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2019-10-10T13:40:18Z</dc:date>
    </item>
    <item>
      <title>Re: Sort expression not working</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-expression-not-working/m-p/1633701#M732302</link>
      <description>&lt;P&gt;Marcus - I wasn't aware a calculated dimension couldn't be sorted like this.&amp;nbsp; I changed it to match your example using the dual function/method and sorting by the number and it worked.&amp;nbsp; Thanks!&lt;/P&gt;&lt;P&gt;All - thank you very much for all the assistance.&amp;nbsp; It's greatly appreciated.&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2019 13:59:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-expression-not-working/m-p/1633701#M732302</guid>
      <dc:creator>meckeard</dc:creator>
      <dc:date>2019-10-10T13:59:38Z</dc:date>
    </item>
  </channel>
</rss>

