<?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: Problem sorting chart with conditional expressions in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Problem-sorting-chart-with-conditional-expressions/m-p/866705#M303192</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Since you are conditionally manipulating the number of columns that are displayed in the table, the sort order is getting changed ..&lt;/P&gt;&lt;P&gt;I think one way to get your sorting priority constant, You need to promote your total to the top of the list in the expressions tab and set the sorting priority. This should work if you do not have a problem in displaying the total column first in the grid&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="SortOrder.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/90228_SortOrder.png" style="height: 543px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="SortOrder1.png" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/90229_SortOrder1.png" style="height: 539px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 22 Jun 2015 08:08:27 GMT</pubDate>
    <dc:creator>sasiparupudi1</dc:creator>
    <dc:date>2015-06-22T08:08:27Z</dc:date>
    <item>
      <title>Problem sorting chart with conditional expressions</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-sorting-chart-with-conditional-expressions/m-p/866697#M303184</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've an issue sorting my chart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The use case is, that I have a chart calculating values for the last 12/24 rolling months or 4/8 rolling quarters. Therefore my chart shows wheter 4, 8, 12 or 24 columns, depending on the selection of type (quarterly/monthly) and duration (12/24 months).&lt;BR /&gt;To sum those values up I've got one more expression calculating the total of the &lt;SPAN style="font-size: 13.3333330154419px;"&gt;last 12/24 rolling months or 4/8 rolling quarters.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd like to always sort my chart by this total column, but as soon as I change one of the options type or duration the chart loses the sort setting of sorting by this Total column descending.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attached you can find a sample application with the same problem.&lt;/P&gt;&lt;P&gt;I'd like to sort by the total column, therefore I change the priority of the total column in the chart to the top and select sort by numeric value descending.&lt;/P&gt;&lt;P&gt;As soon as i switch the type, the sort order is set to default again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions how I could avoid this problem?&lt;BR /&gt;I don't want to change the straight table to a pivot chart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;Patrick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Jun 2015 11:20:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-sorting-chart-with-conditional-expressions/m-p/866697#M303184</guid>
      <dc:creator>patroser</dc:creator>
      <dc:date>2015-06-20T11:20:58Z</dc:date>
    </item>
    <item>
      <title>Re: Problem sorting chart with conditional expressions</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-sorting-chart-with-conditional-expressions/m-p/866698#M303185</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/90167_Capture.PNG" style="height: 201px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Sunny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Jun 2015 11:57:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-sorting-chart-with-conditional-expressions/m-p/866698#M303185</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-06-20T11:57:05Z</dc:date>
    </item>
    <item>
      <title>Re: Problem sorting chart with conditional expressions</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-sorting-chart-with-conditional-expressions/m-p/866699#M303186</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I already took this Option into account.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately this brings up another problem. I've got more than just one dimension.&lt;/P&gt;&lt;P&gt;Sorting dim1 by expression leads to the total column not being sorted completely descending. I'm writing from my smart phone, I hope I can explain the example properly:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Dimension1&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Dimension2&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Total&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Customer 5&lt;/TD&gt;&lt;TD&gt;variant 02&lt;/TD&gt;&lt;TD&gt;534&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Customer 5&lt;/TD&gt;&lt;TD&gt;variant 01&lt;/TD&gt;&lt;TD&gt;236&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Customer 23&lt;/TD&gt;&lt;TD&gt;variant 02&lt;/TD&gt;&lt;TD&gt;610&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Customer 23&lt;/TD&gt;&lt;TD&gt;variant 01&lt;/TD&gt;&lt;TD&gt;34&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Customer 23&lt;/TD&gt;&lt;TD&gt;variant 03&lt;/TD&gt;&lt;TD&gt;27&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Customer 13&lt;/TD&gt;&lt;TD&gt;variant 03&lt;/TD&gt;&lt;TD&gt;465&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Customer 13&lt;/TD&gt;&lt;TD&gt;variant 01&lt;/TD&gt;&lt;TD&gt;68&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But the sort order I would like to have is:&lt;/P&gt;&lt;P&gt;610&lt;/P&gt;&lt;P&gt;534&lt;/P&gt;&lt;P&gt;465&lt;/P&gt;&lt;P&gt;236&lt;/P&gt;&lt;P&gt;68&lt;/P&gt;&lt;P&gt;34&lt;/P&gt;&lt;P&gt;27&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Patrick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Jun 2015 12:27:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-sorting-chart-with-conditional-expressions/m-p/866699#M303186</guid>
      <dc:creator>patroser</dc:creator>
      <dc:date>2015-06-20T12:27:35Z</dc:date>
    </item>
    <item>
      <title>Re: Problem sorting chart with conditional expressions</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-sorting-chart-with-conditional-expressions/m-p/866700#M303187</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I see what you are saying now. While looking for a permanent solution still, I can suggest a work around of placing two charts on top of each other and conditionally hide and show them based on your GetCurrentField() selection.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Jun 2015 14:23:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-sorting-chart-with-conditional-expressions/m-p/866700#M303187</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-06-20T14:23:37Z</dc:date>
    </item>
    <item>
      <title>Re: Problem sorting chart with conditional expressions</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-sorting-chart-with-conditional-expressions/m-p/866701#M303188</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Although still a work around, but its better than having two charts. Using the following script I created a new field with a combination of Dimension1&amp;amp;Dimension2 and called it sort&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Table:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD Dimension1, &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dimension2, &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Total as Value,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dimension1&amp;amp;Dimension2 as Sort&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FROM&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;A class="jive-link-thread-small" data-containerid="2051" data-containertype="14" data-objectid="169261" data-objecttype="1" href="https://community.qlik.com/thread/169261"&gt;https://community.qlik.com/thread/169261&lt;/A&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(html, codepage is 1252, embedded labels, table is @1);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Added Sort as a dimension for you chart and hide it and use a expression sort on this new field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Seems to work, see if this is helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Sunny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Jun 2015 14:30:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-sorting-chart-with-conditional-expressions/m-p/866701#M303188</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-06-20T14:30:28Z</dc:date>
    </item>
    <item>
      <title>Re: Problem sorting chart with conditional expressions</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-sorting-chart-with-conditional-expressions/m-p/866702#M303189</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your help, I think I'm going to discuss this topic with my client again.&lt;/P&gt;&lt;P&gt;Could be the sort by expression is still enough for him.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it's not enough I'll need to calculate everything in the script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Patrick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Jun 2015 14:41:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-sorting-chart-with-conditional-expressions/m-p/866702#M303189</guid>
      <dc:creator>patroser</dc:creator>
      <dc:date>2015-06-21T14:41:53Z</dc:date>
    </item>
    <item>
      <title>Re: Problem sorting chart with conditional expressions</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-sorting-chart-with-conditional-expressions/m-p/866703#M303190</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But still I'd like to know if this behaviour is as expected or not.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Jun 2015 14:44:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-sorting-chart-with-conditional-expressions/m-p/866703#M303190</guid>
      <dc:creator>patroser</dc:creator>
      <dc:date>2015-06-21T14:44:37Z</dc:date>
    </item>
    <item>
      <title>Re: Problem sorting chart with conditional expressions</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-sorting-chart-with-conditional-expressions/m-p/866704#M303191</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am not sure if this is the intended behavior, but I have seen that this is what I have seen for some of the other charts I have made within the applications I have worked on. But since there was never an importance on getting the sorting right, I never worked on getting it right for more than 5-10 mins and moved on with what I got.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Jun 2015 15:56:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-sorting-chart-with-conditional-expressions/m-p/866704#M303191</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-06-21T15:56:09Z</dc:date>
    </item>
    <item>
      <title>Re: Problem sorting chart with conditional expressions</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-sorting-chart-with-conditional-expressions/m-p/866705#M303192</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Since you are conditionally manipulating the number of columns that are displayed in the table, the sort order is getting changed ..&lt;/P&gt;&lt;P&gt;I think one way to get your sorting priority constant, You need to promote your total to the top of the list in the expressions tab and set the sorting priority. This should work if you do not have a problem in displaying the total column first in the grid&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="SortOrder.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/90228_SortOrder.png" style="height: 543px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="SortOrder1.png" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/90229_SortOrder1.png" style="height: 539px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jun 2015 08:08:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-sorting-chart-with-conditional-expressions/m-p/866705#M303192</guid>
      <dc:creator>sasiparupudi1</dc:creator>
      <dc:date>2015-06-22T08:08:27Z</dc:date>
    </item>
    <item>
      <title>Re: Problem sorting chart with conditional expressions</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-sorting-chart-with-conditional-expressions/m-p/866706#M303193</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;Can you try the below attachment.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jun 2015 08:56:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-sorting-chart-with-conditional-expressions/m-p/866706#M303193</guid>
      <dc:creator>settu_periasamy</dc:creator>
      <dc:date>2015-06-22T08:56:04Z</dc:date>
    </item>
    <item>
      <title>Re: Problem sorting chart with conditional expressions</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-sorting-chart-with-conditional-expressions/m-p/866707#M303194</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your advice, I think this will work for my client&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Patrick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jun 2015 09:02:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-sorting-chart-with-conditional-expressions/m-p/866707#M303194</guid>
      <dc:creator>patroser</dc:creator>
      <dc:date>2015-06-22T09:02:42Z</dc:date>
    </item>
    <item>
      <title>Re: Problem sorting chart with conditional expressions</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-sorting-chart-with-conditional-expressions/m-p/866708#M303195</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This also looks good, but:&lt;/P&gt;&lt;P&gt;I'm wondering, if we conditionally hide the column instead of the expression, I guess the engine still does the math for all the columns, right?&lt;BR /&gt;Doesn't matter in the specific case, because there's not that much to calculate, but in cases of millions of rows, I'm afraid this solution has a significant impact on the performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or am I getting it wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Patrick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jun 2015 09:05:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-sorting-chart-with-conditional-expressions/m-p/866708#M303195</guid>
      <dc:creator>patroser</dc:creator>
      <dc:date>2015-06-22T09:05:15Z</dc:date>
    </item>
    <item>
      <title>Re: Problem sorting chart with conditional expressions</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-sorting-chart-with-conditional-expressions/m-p/866709#M303196</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Patrick,&lt;/P&gt;&lt;P&gt;Actually, I tried with this (conditionally hide the column instead of the expression) application which is having millions of records. I don't find any performance issue.&lt;/P&gt;&lt;P&gt;May be some experts will give the proper answer for this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jun 2015 09:52:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-sorting-chart-with-conditional-expressions/m-p/866709#M303196</guid>
      <dc:creator>settu_periasamy</dc:creator>
      <dc:date>2015-06-22T09:52:25Z</dc:date>
    </item>
    <item>
      <title>Re: Problem sorting chart with conditional expressions</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-sorting-chart-with-conditional-expressions/m-p/866710#M303197</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just 4 Info:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think I figured out, that just hiding the column instead of the expression is indeed of better performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We had close to 40 conditional expressions. &lt;/P&gt;&lt;P&gt;Working with the qvw itself wasn't a problem, but working via "open in server" took about one minute to load the chart containing the conditional expressions. &lt;/P&gt;&lt;P&gt;Switching the condition from expression to column improved the performance. Afterwards it just took a few seconds to load the chart.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Aug 2015 14:51:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-sorting-chart-with-conditional-expressions/m-p/866710#M303197</guid>
      <dc:creator>patroser</dc:creator>
      <dc:date>2015-08-25T14:51:56Z</dc:date>
    </item>
  </channel>
</rss>

