<?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: Wrong Total Sums in Pivot Table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Wrong-Total-Sums-in-Pivot-Table/m-p/2464995#M1225854</link>
    <description>&lt;P&gt;The calculation itself is correct. That you didn't get the wanted result is caused from your condition which isn't fulfilled on the total-level and considering the Cost of 50 for Sales3.&lt;/P&gt;
&lt;P&gt;You could adjust it by wrapping the calculation with an aggr() to enforce a summing against the row-level. This may look like:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;sum(aggr(rangemax(sum(Sales)-sum(Cost), 0), RegionName, LineName))&lt;/P&gt;
&lt;P&gt;and to enable the logic against the dimension-groups you need to query the active group. This means for example replacing the dimension of RegionName with:&lt;/P&gt;
&lt;P&gt;[$(=getcurrentfield(YourGroupName))]&lt;/P&gt;</description>
    <pubDate>Mon, 24 Jun 2024 13:45:38 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2024-06-24T13:45:38Z</dc:date>
    <item>
      <title>Wrong Total Sums in Pivot Table</title>
      <link>https://community.qlik.com/t5/QlikView/Wrong-Total-Sums-in-Pivot-Table/m-p/2464976#M1225853</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I have a pivot table with two columns called Sales and Cost. Profit = Sales - Cost but still not working. What I am doing wrong?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Here's a screen shot:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Phan_Anh_Son_0-1719234981162.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/168392i0534D3D9428EF6B5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Phan_Anh_Son_0-1719234981162.png" alt="Phan_Anh_Son_0-1719234981162.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2024 13:18:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Wrong-Total-Sums-in-Pivot-Table/m-p/2464976#M1225853</guid>
      <dc:creator>Phan_Anh_Son</dc:creator>
      <dc:date>2024-06-24T13:18:45Z</dc:date>
    </item>
    <item>
      <title>Re: Wrong Total Sums in Pivot Table</title>
      <link>https://community.qlik.com/t5/QlikView/Wrong-Total-Sums-in-Pivot-Table/m-p/2464995#M1225854</link>
      <description>&lt;P&gt;The calculation itself is correct. That you didn't get the wanted result is caused from your condition which isn't fulfilled on the total-level and considering the Cost of 50 for Sales3.&lt;/P&gt;
&lt;P&gt;You could adjust it by wrapping the calculation with an aggr() to enforce a summing against the row-level. This may look like:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;sum(aggr(rangemax(sum(Sales)-sum(Cost), 0), RegionName, LineName))&lt;/P&gt;
&lt;P&gt;and to enable the logic against the dimension-groups you need to query the active group. This means for example replacing the dimension of RegionName with:&lt;/P&gt;
&lt;P&gt;[$(=getcurrentfield(YourGroupName))]&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2024 13:45:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Wrong-Total-Sums-in-Pivot-Table/m-p/2464995#M1225854</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2024-06-24T13:45:38Z</dc:date>
    </item>
    <item>
      <title>Re: Wrong Total Sums in Pivot Table</title>
      <link>https://community.qlik.com/t5/QlikView/Wrong-Total-Sums-in-Pivot-Table/m-p/2465004#M1225855</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Works, thanks for your help&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2024 14:07:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Wrong-Total-Sums-in-Pivot-Table/m-p/2465004#M1225855</guid>
      <dc:creator>Phan_Anh_Son</dc:creator>
      <dc:date>2024-06-24T14:07:07Z</dc:date>
    </item>
  </channel>
</rss>

