<?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: PivotTable (Dynamic Table) subtotal is wrong in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/PivotTable-Dynamic-Table-subtotal-is-wrong/m-p/77516#M786693</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use variables if you would not like to repeat the expressions over and over again, but column labels don't really work within Aggr() function.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 23 Feb 2018 13:30:29 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2018-02-23T13:30:29Z</dc:date>
    <item>
      <title>PivotTable (Dynamic Table) subtotal is wrong</title>
      <link>https://community.qlik.com/t5/QlikView/PivotTable-Dynamic-Table-subtotal-is-wrong/m-p/77511#M786687</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a dynamic table with three dimensions (country, state, city) and three expressions (sales, deliveries, pending).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The expression "pending" is a formula: if (deliveries&amp;gt; sales, 0, Ceil ((sales - deliveries), 1))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By hypothesis, three lines;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in the first, pending = 10;&lt;/P&gt;&lt;P&gt;in the second, pending = 0 (deliveries are greater than sales, without the formula, the result would be -5);&lt;/P&gt;&lt;P&gt;in the third, pending = 20.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Subtotal display is enabled; the sum should be 30 (10 + 0 + 20). But he checks 25 (10 - 5 + 20). Why?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried some combinations using AGGR in the formula, but I did not succeed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/PivotTable-Dynamic-Table-subtotal-is-wrong/m-p/77511#M786687</guid>
      <dc:creator>luiz_damascena</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: PivotTable (Dynamic Table) subtotal is wrong</title>
      <link>https://community.qlik.com/t5/QlikView/PivotTable-Dynamic-Table-subtotal-is-wrong/m-p/77512#M786688</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sum(Aggr(If&lt;/STRONG&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;(Expression4DeliveriesHere &amp;gt; Expression4SalesHere, 0, Ceil((&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Expression4SalesHere&lt;/SPAN&gt;- &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Expression4DeliveriesHere&lt;/SPAN&gt;), 1)), country, state, city))&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Feb 2018 13:02:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/PivotTable-Dynamic-Table-subtotal-is-wrong/m-p/77512#M786688</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-02-23T13:02:38Z</dc:date>
    </item>
    <item>
      <title>Re: PivotTable (Dynamic Table) subtotal is wrong</title>
      <link>https://community.qlik.com/t5/QlikView/PivotTable-Dynamic-Table-subtotal-is-wrong/m-p/77513#M786689</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;First of all, the expression &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;if&lt;/SPAN&gt; (&lt;SPAN style="color: #993300;"&gt;deliveries&lt;/SPAN&gt;&amp;gt; &lt;SPAN style="color: #993300;"&gt;sales&lt;/SPAN&gt;, 0, &lt;SPAN style="color: #0000ff;"&gt;Ceil&lt;/SPAN&gt; ((&lt;SPAN style="color: #993300;"&gt;sales&lt;/SPAN&gt; - &lt;SPAN style="color: #993300;"&gt;deliveries&lt;/SPAN&gt;), 1))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;contains several naked field references, and these can often not be used in your measures. You need to wrap all field references in an aggregation function like Sum(). I.e. you need to decide whether to aggregate first, and then use the condition in the If(), or if you want to use the condition in the If() on each data record, and then aggregate. &lt;/SPAN&gt;See more on &lt;A href="https://community.qlik.com/qlik-blogpost/3779"&gt;Use Aggregation Functions!&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Further, the subtotal is not necessarily the sum of rows - and it shouldn't be. See &lt;A href="https://community.qlik.com/qlik-blogpost/3798"&gt;Totals in Charts&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Finally, if you choose a solution with Aggr(), the structure should be&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;Sum&lt;/SPAN&gt;(&lt;SPAN style="color: #993300;"&gt;Aggr&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;Sum&lt;/SPAN&gt;(...), ... ))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Note that you should have one aggregation function outside the Aggr() and a second inside the Aggr().&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;HIC &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Feb 2018 13:20:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/PivotTable-Dynamic-Table-subtotal-is-wrong/m-p/77513#M786689</guid>
      <dc:creator>hic</dc:creator>
      <dc:date>2018-02-23T13:20:16Z</dc:date>
    </item>
    <item>
      <title>Re: PivotTable (Dynamic Table) subtotal is wrong</title>
      <link>https://community.qlik.com/t5/QlikView/PivotTable-Dynamic-Table-subtotal-is-wrong/m-p/77514#M786690</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;It worked perfectly!&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not being able to use the names of the expressions, and having to repeat all the content of the same ones in the formula, is annoying ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But thanks, the solution worked perfectly.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Feb 2018 13:26:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/PivotTable-Dynamic-Table-subtotal-is-wrong/m-p/77514#M786690</guid>
      <dc:creator>luiz_damascena</dc:creator>
      <dc:date>2018-02-23T13:26:51Z</dc:date>
    </item>
    <item>
      <title>Re: PivotTable (Dynamic Table) subtotal is wrong</title>
      <link>https://community.qlik.com/t5/QlikView/PivotTable-Dynamic-Table-subtotal-is-wrong/m-p/77515#M786691</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks! the links are of excellent material.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Feb 2018 13:28:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/PivotTable-Dynamic-Table-subtotal-is-wrong/m-p/77515#M786691</guid>
      <dc:creator>luiz_damascena</dc:creator>
      <dc:date>2018-02-23T13:28:34Z</dc:date>
    </item>
    <item>
      <title>Re: PivotTable (Dynamic Table) subtotal is wrong</title>
      <link>https://community.qlik.com/t5/QlikView/PivotTable-Dynamic-Table-subtotal-is-wrong/m-p/77516#M786693</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use variables if you would not like to repeat the expressions over and over again, but column labels don't really work within Aggr() function.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Feb 2018 13:30:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/PivotTable-Dynamic-Table-subtotal-is-wrong/m-p/77516#M786693</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-02-23T13:30:29Z</dc:date>
    </item>
  </channel>
</rss>

