<?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 Calculate Total For 2 Rows in Another Row in Pivot Table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calculate-Total-For-2-Rows-in-Another-Row-in-Pivot-Table/m-p/2469454#M1225905</link>
    <description>&lt;P&gt;Hi, I would like to display the total for F and G in H row as shown below. Below are the dimensions and expressions used in the pivot table. Can advise on how can I achieve this. Thank you.&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Current Pivot Table&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MCFH93_0-1720600129117.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/169162i46F279A900F2D051/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MCFH93_0-1720600129117.png" alt="MCFH93_0-1720600129117.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Expected Pivot Table&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MCFH93_1-1720600146796.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/169163iA8003F1C9BF36A48/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MCFH93_1-1720600146796.png" alt="MCFH93_1-1720600146796.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Dimension for Pivot Table&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;(1) SM2_SOURCE&lt;/P&gt;
&lt;P&gt;(2)&amp;nbsp;=IF(DATE(YEAREND(DATE(SM2_DATE, 'DD/MM/YYYY'), 0, 4), 'YYYY') &amp;gt;= YEARSTART(TODAY(), -2, 4), 'FY ' &amp;amp; DATE(YEAREND(DATE(SM2_DATE, 'DD/MM/YYYY'), 0, 4), 'YYYY'))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Expression for Pivot Table&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;(1)&amp;nbsp;tCO₂e = SUM(AGGR(IF(SUM(SM2_VALUE) &amp;gt; 0, (SUM(SM2_VALUE) * SM2_CONVERSION_FACTOR) / 1000), SM2_SOURCE, SM2_DATE))&lt;/P&gt;
&lt;P&gt;(2)&amp;nbsp;MWh =&amp;nbsp;ROUND(SUM(SM2_VALUE) / 1000)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 10 Jul 2024 08:31:12 GMT</pubDate>
    <dc:creator>MCFH93</dc:creator>
    <dc:date>2024-07-10T08:31:12Z</dc:date>
    <item>
      <title>Calculate Total For 2 Rows in Another Row in Pivot Table</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-Total-For-2-Rows-in-Another-Row-in-Pivot-Table/m-p/2469454#M1225905</link>
      <description>&lt;P&gt;Hi, I would like to display the total for F and G in H row as shown below. Below are the dimensions and expressions used in the pivot table. Can advise on how can I achieve this. Thank you.&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Current Pivot Table&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MCFH93_0-1720600129117.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/169162i46F279A900F2D051/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MCFH93_0-1720600129117.png" alt="MCFH93_0-1720600129117.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Expected Pivot Table&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MCFH93_1-1720600146796.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/169163iA8003F1C9BF36A48/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MCFH93_1-1720600146796.png" alt="MCFH93_1-1720600146796.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Dimension for Pivot Table&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;(1) SM2_SOURCE&lt;/P&gt;
&lt;P&gt;(2)&amp;nbsp;=IF(DATE(YEAREND(DATE(SM2_DATE, 'DD/MM/YYYY'), 0, 4), 'YYYY') &amp;gt;= YEARSTART(TODAY(), -2, 4), 'FY ' &amp;amp; DATE(YEAREND(DATE(SM2_DATE, 'DD/MM/YYYY'), 0, 4), 'YYYY'))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Expression for Pivot Table&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;(1)&amp;nbsp;tCO₂e = SUM(AGGR(IF(SUM(SM2_VALUE) &amp;gt; 0, (SUM(SM2_VALUE) * SM2_CONVERSION_FACTOR) / 1000), SM2_SOURCE, SM2_DATE))&lt;/P&gt;
&lt;P&gt;(2)&amp;nbsp;MWh =&amp;nbsp;ROUND(SUM(SM2_VALUE) / 1000)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2024 08:31:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-Total-For-2-Rows-in-Another-Row-in-Pivot-Table/m-p/2469454#M1225905</guid>
      <dc:creator>MCFH93</dc:creator>
      <dc:date>2024-07-10T08:31:12Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Total For 2 Rows in Another Row in Pivot Table</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-Total-For-2-Rows-in-Another-Row-in-Pivot-Table/m-p/2469536#M1225909</link>
      <description>&lt;P&gt;You may just query the source and using there the wanted calculation, like:&lt;/P&gt;
&lt;P&gt;if(Source = 'x', Expr1, if(Source = 'y', Expr2, ..., ExprX))&lt;/P&gt;
&lt;P&gt;Beside this you could add some upper dimension-level and then using their partial sums and/or a query on the dimensionality() to branch within different calculations.&lt;/P&gt;
&lt;P&gt;Independent from this I suggest to replace the calculated date-dimension with native fields from an appropriate calendar and also the check if the calculation of&amp;nbsp;&lt;SPAN&gt;tCO₂e&lt;/SPAN&gt;&amp;nbsp; requires really an aggr() and an if-loop.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2024 12:20:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-Total-For-2-Rows-in-Another-Row-in-Pivot-Table/m-p/2469536#M1225909</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2024-07-10T12:20:36Z</dc:date>
    </item>
  </channel>
</rss>

