<?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: Pivot table sort by expression issue in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Pivot-table-sort-by-expression-issue/m-p/577093#M214652</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;This is probably a bit of an overly complicated way to go about it but you could try to add a calculated dimension using (Aggr(Sum(TR), ORGANISATION, CURRENCY)), sort by the currency column and then by the calculated dimension. Then you can hide the calculated dimension using the macro in the below link (i.e. the sub Squeeze one)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://qlikcommunity.qliktech.com/thread/18116" title="http://qlikcommunity.qliktech.com/thread/18116"&gt;Hiding Dimension (pivot) by using Sheet Properties | Qlik Community&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 27 Feb 2014 11:21:05 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-02-27T11:21:05Z</dc:date>
    <item>
      <title>Pivot table sort by expression issue</title>
      <link>https://community.qlik.com/t5/QlikView/Pivot-table-sort-by-expression-issue/m-p/577092#M214651</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a bit of a problem with sort by expression in pivot table. The table and data look something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" jive-data-cell="{&amp;quot;color&amp;quot;:&amp;quot;#575757&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;left&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;2&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;transparent&amp;quot;,&amp;quot;fontFamily&amp;quot;:&amp;quot;arial,helvetica,sans-serif&amp;quot;,&amp;quot;verticalAlign&amp;quot;:&amp;quot;baseline&amp;quot;}" jive-data-header="{&amp;quot;color&amp;quot;:&amp;quot;#FFFFFF&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;#6690BC&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;center&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;2&amp;quot;}" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="background-color: #6690bc; color: #ffffff; padding: 2px; text-align: center;" valign="middle"&gt;CURRENCY&lt;/TH&gt;&lt;TH style="background-color: #6690bc; color: #ffffff; padding: 2px; text-align: center;" valign="middle"&gt;ORGANISATION&lt;/TH&gt;&lt;TH style="background-color: #6690bc; color: #ffffff; padding: 2px; text-align: center;" valign="middle"&gt;&lt;STRONG&gt;EXPR1&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="background-color: #6690bc; color: #ffffff; padding: 2px; text-align: center;" valign="middle"&gt;&lt;STRONG&gt;THESUM=SUM(TR)&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD rowspan="3" style="padding: 2px; text-align: center;"&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EUR&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;ORG1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;-&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;80 000.00&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;ORG2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;-&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;STRONG&gt;2 000.00&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;ORG3&lt;/TD&gt;&lt;TD&gt;-&lt;/TD&gt;&lt;TD&gt;10 000.00&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD rowspan="2" style="padding: 2px; text-align: center;"&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RUR&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;ORG4&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;-&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;100 000.00&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;ORG2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;-&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;STRONG&gt;60 000.00&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to sort it by the values of THESUM (desc) for each CURRENCY + ORGANISATION row.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dimensions are CURRENCY and ORGANISATION (+ a couple collapsed others which are irrelevant to this). Can't alter the table's structure in any way so placing THESUM as first expression and have a Y-sort is out of the question (even if it works - I checked &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/sad.png" /&gt; ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My current sort expression looks like this&lt;/P&gt;&lt;P&gt;CURRENCY by name&lt;/P&gt;&lt;P&gt;ORGANISATION by expression: sum(TOTAL &amp;lt;CURRENCY, ORGANISATION&amp;gt; TR)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So ORG2 has two currencies and it would seem that the sort just takes the sum of the entire ORG2 (which is 62k) instead of just a part that uses EUROS (2k).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is how I want the table to look like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" jive-data-cell="{&amp;quot;color&amp;quot;:&amp;quot;#575757&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;left&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;2&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;transparent&amp;quot;,&amp;quot;fontFamily&amp;quot;:&amp;quot;arial,helvetica,sans-serif&amp;quot;,&amp;quot;verticalAlign&amp;quot;:&amp;quot;baseline&amp;quot;}" jive-data-header="{&amp;quot;color&amp;quot;:&amp;quot;#FFFFFF&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;#6690BC&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;center&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;2&amp;quot;}" style="border: 1px solid #000000; width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="background-color: #6690bc; color: #ffffff; text-align: center;" valign="middle"&gt;&lt;STRONG&gt;CURRENCY&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="background-color: #6690bc; color: #ffffff; text-align: center;" valign="middle"&gt;ORGANISATION&lt;/TH&gt;&lt;TH style="background-color: #6690bc; color: #ffffff; text-align: center;" valign="middle"&gt;EXPR1&lt;/TH&gt;&lt;TH style="background-color: #6690bc; color: #ffffff; text-align: center;" valign="middle"&gt;&lt;STRONG&gt;THESUM=SUM(TR)&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD rowspan="3" style="padding: 2px; text-align: center;"&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EUR&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;ORG1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;-&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;80 000.00&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;ORG3&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;-&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;10 000.00&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;ORG2&lt;/TD&gt;&lt;TD&gt;-&lt;/TD&gt;&lt;TD&gt;2 000.00&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD rowspan="2" style="padding: 2px; text-align: center;"&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RUR&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;ORG4&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;-&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;100 000.00&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;ORG2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;-&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;60 000.00&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there something (probably trivial) I'm missing because this has been SO frustrating &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/sad.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Feb 2014 08:40:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pivot-table-sort-by-expression-issue/m-p/577092#M214651</guid>
      <dc:creator />
      <dc:date>2014-02-27T08:40:14Z</dc:date>
    </item>
    <item>
      <title>Re: Pivot table sort by expression issue</title>
      <link>https://community.qlik.com/t5/QlikView/Pivot-table-sort-by-expression-issue/m-p/577093#M214652</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;This is probably a bit of an overly complicated way to go about it but you could try to add a calculated dimension using (Aggr(Sum(TR), ORGANISATION, CURRENCY)), sort by the currency column and then by the calculated dimension. Then you can hide the calculated dimension using the macro in the below link (i.e. the sub Squeeze one)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://qlikcommunity.qliktech.com/thread/18116" title="http://qlikcommunity.qliktech.com/thread/18116"&gt;Hiding Dimension (pivot) by using Sheet Properties | Qlik Community&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Feb 2014 11:21:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pivot-table-sort-by-expression-issue/m-p/577093#M214652</guid>
      <dc:creator />
      <dc:date>2014-02-27T11:21:05Z</dc:date>
    </item>
    <item>
      <title>Re: Pivot table sort by expression issue</title>
      <link>https://community.qlik.com/t5/QlikView/Pivot-table-sort-by-expression-issue/m-p/577094#M214653</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nevermind. I found a way to trick the system. I am operating with 3 currencies so I just put 1, 2 and 3 spaces after ORGANISATION depending on the currency (that way the ORGANISATION dimension is technically combined with CURRENCY now and it makes the sort by expression work (still can't understand why it didn't before though) but is invisible).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I realise that it's a bit dumb and not very efficient but it's better than nothing &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Feb 2014 13:55:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pivot-table-sort-by-expression-issue/m-p/577094#M214653</guid>
      <dc:creator />
      <dc:date>2014-02-27T13:55:29Z</dc:date>
    </item>
  </channel>
</rss>

