<?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 Sorting on Y value in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Sorting-on-Y-value/m-p/193769#M54905</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm afraid that has defeated me, I've been trying all day to get that to work on my data. I keep getting the error message 'bad field name' when i've typed in the name of the cyclic group I've created with the new fields.&lt;/P&gt;&lt;P&gt;I'll try again after the weekend.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Sep 2010 16:57:17 GMT</pubDate>
    <dc:creator>ljdlumley</dc:creator>
    <dc:date>2010-09-10T16:57:17Z</dc:date>
    <item>
      <title>Sorting on Y value</title>
      <link>https://community.qlik.com/t5/QlikView/Sorting-on-Y-value/m-p/193765#M54901</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, this is probably a basic question but I can't find the solution on the forums.&lt;/P&gt;&lt;P&gt;I have a dimension 'Year' containing 2009 and 2010. When I create a bar chart (grouped rather than stacked) and sort on the y value the data is sorted by the combined y values of 2009 and 2010 i.e. department 1 has a score of 90 in 2009 and 90 in 2010, department 2 has a score of 70 in 2009 and 100 in 2010. Department 1 is first in the chart as the combined scores are 180 as opposed to department 2 score of 170. However, I would like to sort by the value for the latest year so that department 2 comes first in the chart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any thoughts on how I'd achieve this?&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;John&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Sep 2010 17:12:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sorting-on-Y-value/m-p/193765#M54901</guid>
      <dc:creator>ljdlumley</dc:creator>
      <dc:date>2010-09-08T17:12:24Z</dc:date>
    </item>
    <item>
      <title>Sorting on Y value</title>
      <link>https://community.qlik.com/t5/QlikView/Sorting-on-Y-value/m-p/193766#M54902</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe sort by expression descending, and use an expression like this?&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;sum({&amp;lt;Year={'$(=max(Year))'}&amp;gt;} Score)&lt;/P&gt;&lt;P&gt;Or whatever your score expression is, plus set analysis to tell it to only pull in the latest year.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Sep 2010 17:16:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sorting-on-Y-value/m-p/193766#M54902</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2010-09-08T17:16:22Z</dc:date>
    </item>
    <item>
      <title>Sorting on Y value</title>
      <link>https://community.qlik.com/t5/QlikView/Sorting-on-Y-value/m-p/193767#M54903</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks John, that works exactly as I wanted.&lt;/P&gt;&lt;P&gt;Now I'd like to make it a bit more complicated! I've actually got 5 expressions that I have grouped together to cycle through (these are different categories of a survey) so whereas in the example above I would use my 'Score' expression, I'd like a way to include a variable in the formula to pull through which expression is currently selected.&lt;/P&gt;&lt;P&gt;cheers&lt;/P&gt;&lt;P&gt;John&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Sep 2010 10:48:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sorting-on-Y-value/m-p/193767#M54903</guid>
      <dc:creator>ljdlumley</dc:creator>
      <dc:date>2010-09-09T10:48:15Z</dc:date>
    </item>
    <item>
      <title>Sorting on Y value</title>
      <link>https://community.qlik.com/t5/QlikView/Sorting-on-Y-value/m-p/193768#M54904</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortunately, I don't think there's any way to detect which expression is currently selected. What I've done in similar situations is create a table with fields disconnected from my data model, one field per expression I want:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;LOAD * INLINE [&lt;BR /&gt;Something, Something Else, Other&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;Then I put those fields in a cyclic dimension group. Then I use the selected dimension to drive which expression displays:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;pick(match(getcurrentfield(MyGroup),'Something','Something Else','Other')&lt;BR /&gt;,sum(Score)&lt;BR /&gt;,avg(Score+Score2)&lt;BR /&gt;,max(Score2))&lt;/P&gt;&lt;P&gt;And your sort expression could be:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;pick(match(getcurrentfield(MyGroup),'Something','Something Else','Other')&lt;BR /&gt;,sum(({&amp;lt;Year={'$(=max(Year))'}&amp;gt;} Score)&lt;BR /&gt;,avg(({&amp;lt;Year={'$(=max(Year))'}&amp;gt;} Score+Score2)&lt;BR /&gt;,max(({&amp;lt;Year={'$(=max(Year))'}&amp;gt;} Score2))&lt;/P&gt;&lt;P&gt;There might be a cleaner way, but I'm not thinking of one. At least it's &lt;EM&gt;A&lt;/EM&gt; way, assuming it works, and if nobody comes up with something better.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Sep 2010 18:17:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sorting-on-Y-value/m-p/193768#M54904</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2010-09-09T18:17:15Z</dc:date>
    </item>
    <item>
      <title>Sorting on Y value</title>
      <link>https://community.qlik.com/t5/QlikView/Sorting-on-Y-value/m-p/193769#M54905</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm afraid that has defeated me, I've been trying all day to get that to work on my data. I keep getting the error message 'bad field name' when i've typed in the name of the cyclic group I've created with the new fields.&lt;/P&gt;&lt;P&gt;I'll try again after the weekend.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Sep 2010 16:57:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sorting-on-Y-value/m-p/193769#M54905</guid>
      <dc:creator>ljdlumley</dc:creator>
      <dc:date>2010-09-10T16:57:17Z</dc:date>
    </item>
    <item>
      <title>Sorting on Y value</title>
      <link>https://community.qlik.com/t5/QlikView/Sorting-on-Y-value/m-p/193770#M54906</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's an example using a cyclic group to mimic an expression group, including a sort order that depends on which expression is currently selected. It's obviously not your specific case, but perhaps a simplistic example will still be helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Sep 2010 17:22:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sorting-on-Y-value/m-p/193770#M54906</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2010-09-10T17:22:05Z</dc:date>
    </item>
    <item>
      <title>Sorting on Y value</title>
      <link>https://community.qlik.com/t5/QlikView/Sorting-on-Y-value/m-p/193771#M54907</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="jive_text_macro jive_macro_quote" jivemacro="quote"&gt;&lt;BR /&gt;ljdlumley wrote:I keep getting the error message 'bad field name' when i've typed in the name of the cyclic group&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;This is not a true error. It's just a limitation or bug of the syntax checker. Ignore the error message and press on.&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Sep 2010 18:29:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sorting-on-Y-value/m-p/193771#M54907</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2010-09-10T18:29:57Z</dc:date>
    </item>
  </channel>
</rss>

