<?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 Problem with changing order of pivot table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Problem-with-changing-order-of-pivot-table/m-p/572114#M213147</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;i have a problem with a pivot table specifically with the native function that allow user to change the order of the column of the table.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Immagine.JPG.jpg" class="jive-image" src="https://community.qlik.com/legacyfs/online/52165_Immagine.JPG.jpg" /&gt;&lt;/P&gt;&lt;P&gt;If i maintain the column in this order, everything is ok, but if i invert the father and the son the result is uncorrect.&lt;/P&gt;&lt;P&gt;This depends by the formula that is calculate with this script:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;if(Dimensionality()=1,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; aggr(sum(Qte_A), father)/ aggr(sum(aggr(max(Qte_B),father,son)), father)*1000000,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; if (Dimensionality()=0, &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum(Qte_A)/sum(aggr(max(Qte_B),son))*1000000,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; aggr(sum(Qte_A), father,son) / aggr(max(Qte_B, father,son)*1000000))&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;The problems is in the aggregation function that must change as the order of the column.&lt;/P&gt;&lt;P&gt;So there is any function that&amp;nbsp; relieve the field of the column? or other function as a macro or other?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best &lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 27 Jan 2014 15:52:52 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-01-27T15:52:52Z</dc:date>
    <item>
      <title>Problem with changing order of pivot table</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-changing-order-of-pivot-table/m-p/572114#M213147</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;i have a problem with a pivot table specifically with the native function that allow user to change the order of the column of the table.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Immagine.JPG.jpg" class="jive-image" src="https://community.qlik.com/legacyfs/online/52165_Immagine.JPG.jpg" /&gt;&lt;/P&gt;&lt;P&gt;If i maintain the column in this order, everything is ok, but if i invert the father and the son the result is uncorrect.&lt;/P&gt;&lt;P&gt;This depends by the formula that is calculate with this script:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;if(Dimensionality()=1,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; aggr(sum(Qte_A), father)/ aggr(sum(aggr(max(Qte_B),father,son)), father)*1000000,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; if (Dimensionality()=0, &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum(Qte_A)/sum(aggr(max(Qte_B),son))*1000000,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; aggr(sum(Qte_A), father,son) / aggr(max(Qte_B, father,son)*1000000))&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;The problems is in the aggregation function that must change as the order of the column.&lt;/P&gt;&lt;P&gt;So there is any function that&amp;nbsp; relieve the field of the column? or other function as a macro or other?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best &lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jan 2014 15:52:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-changing-order-of-pivot-table/m-p/572114#M213147</guid>
      <dc:creator />
      <dc:date>2014-01-27T15:52:52Z</dc:date>
    </item>
  </channel>
</rss>

