<?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 Pivot total value different from sum of rows value in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Pivot-total-value-different-from-sum-of-rows-value/m-p/68122#M511652</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I'm not very experienced in QlikView and I need help in this pivot table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/192757_pastedImage_0.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;P&gt;Total value € 1.107,82 is different from from sum of rows value&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;€ 423,70+&lt;/P&gt;&lt;P&gt;€ 494,72+&lt;/P&gt;&lt;P&gt;€ 182,43+&lt;/P&gt;&lt;P&gt;€ 7,72= &lt;/P&gt;&lt;P&gt;€ 1.108,58&lt;/P&gt;&lt;P&gt;and i don't understand why&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can someone help me?&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 07 Feb 2018 18:00:24 GMT</pubDate>
    <dc:creator>paolojolly</dc:creator>
    <dc:date>2018-02-07T18:00:24Z</dc:date>
    <item>
      <title>Pivot total value different from sum of rows value</title>
      <link>https://community.qlik.com/t5/QlikView/Pivot-total-value-different-from-sum-of-rows-value/m-p/68122#M511652</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I'm not very experienced in QlikView and I need help in this pivot table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/192757_pastedImage_0.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;P&gt;Total value € 1.107,82 is different from from sum of rows value&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;€ 423,70+&lt;/P&gt;&lt;P&gt;€ 494,72+&lt;/P&gt;&lt;P&gt;€ 182,43+&lt;/P&gt;&lt;P&gt;€ 7,72= &lt;/P&gt;&lt;P&gt;€ 1.108,58&lt;/P&gt;&lt;P&gt;and i don't understand why&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can someone help me?&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Feb 2018 18:00:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pivot-total-value-different-from-sum-of-rows-value/m-p/68122#M511652</guid>
      <dc:creator>paolojolly</dc:creator>
      <dc:date>2018-02-07T18:00:24Z</dc:date>
    </item>
    <item>
      <title>Re: Pivot total value different from sum of rows value</title>
      <link>https://community.qlik.com/t5/QlikView/Pivot-total-value-different-from-sum-of-rows-value/m-p/68123#M511653</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The partial sum is evaluated in total context, if you need to add up the sum of rows in a pivot table, use advanced aggregation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Sum ( Aggr(&lt;/P&gt;&lt;P&gt;&lt;EM&gt;YourExpression&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;, YourTableDimension(s)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Feb 2018 18:09:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pivot-total-value-different-from-sum-of-rows-value/m-p/68123#M511653</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2018-02-07T18:09:06Z</dc:date>
    </item>
    <item>
      <title>Re: Pivot total value different from sum of rows value</title>
      <link>https://community.qlik.com/t5/QlikView/Pivot-total-value-different-from-sum-of-rows-value/m-p/68124#M511654</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply but there is something that I do not understand&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;If I try to do total counts of data without dimension(see table Total data) I get a value(1062.84) different from the one obtained using AGGR (1.063,01)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/192780_pastedImage_0.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And I think the correct value is 1062.84&lt;/P&gt;&lt;P&gt;Thanks again&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Feb 2018 07:37:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pivot-total-value-different-from-sum-of-rows-value/m-p/68124#M511654</guid>
      <dc:creator>paolojolly</dc:creator>
      <dc:date>2018-02-08T07:37:54Z</dc:date>
    </item>
    <item>
      <title>Re: Pivot total value different from sum of rows value</title>
      <link>https://community.qlik.com/t5/QlikView/Pivot-total-value-different-from-sum-of-rows-value/m-p/68125#M511655</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;this is likely because your transaction can map to more than one dimension&lt;/P&gt;&lt;P&gt;e.g. certain transaction may both associate to R1 and R11, so it is counted in both rows&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Feb 2018 08:43:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pivot-total-value-different-from-sum-of-rows-value/m-p/68125#M511655</guid>
      <dc:creator>laujerry</dc:creator>
      <dc:date>2018-02-08T08:43:03Z</dc:date>
    </item>
    <item>
      <title>Re: Pivot total value different from sum of rows value</title>
      <link>https://community.qlik.com/t5/QlikView/Pivot-total-value-different-from-sum-of-rows-value/m-p/68126#M511656</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;I think the solution Stefan has proposed is the correct one (i.e. it provides the correct totals, which is 1063.01 &lt;SPAN style="font-size: 13.3333px;"&gt;not &lt;/SPAN&gt;1062.84)&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;I believe the issue is both with your data and with your expressions&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;You have a "D_AGENTE_DEST" (F9) that is missing "W_TOT_IMP_RIGA_NETNET" for a few months&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;The implication of this is clear when you divide by a number that you calculate with a series of if statements; look at the expression "dati altri trim" in the "Total Data" table. You are dividing by the following 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;if(sum(IF(ANNO_DOC = (vCurrentYear-5)&amp;nbsp; AND MAKEDATE((vCurrentYear-5) , 1, 1) &amp;gt;= MakeDate(2009, 1, 1) AND 2 = Ceil(MESE_DOC/3), W_TOT_IMP_RIGA_NETNET, 0)) &amp;lt;&amp;gt; 0, 1, 0) + &lt;/P&gt;&lt;P&gt;if(sum(IF(ANNO_DOC = (vCurrentYear-4)&amp;nbsp; AND MAKEDATE((vCurrentYear-4) , 1, 1) &amp;gt;= MakeDate(2009, 1, 1) AND 2 = Ceil(MESE_DOC/3), W_TOT_IMP_RIGA_NETNET, 0)) &amp;lt;&amp;gt; 0, 1, 0) + &lt;/P&gt;&lt;P&gt;if(sum(IF(ANNO_DOC = (vCurrentYear-3)&amp;nbsp; AND MAKEDATE((vCurrentYear-3) , 1, 1) &amp;gt;= MakeDate(2009, 1, 1) AND 2 = Ceil(MESE_DOC/3), W_TOT_IMP_RIGA_NETNET, 0)) &amp;lt;&amp;gt; 0, 1, 0) + &lt;/P&gt;&lt;P&gt;if(sum(IF(ANNO_DOC = (vCurrentYear-2)&amp;nbsp; AND MAKEDATE((vCurrentYear-2) , 1, 1) &amp;gt;= MakeDate(2009, 1, 1) AND 2 = Ceil(MESE_DOC/3), W_TOT_IMP_RIGA_NETNET, 0)) &amp;lt;&amp;gt; 0, 1, 0) + &lt;/P&gt;&lt;P&gt;if(sum(IF(ANNO_DOC = (vCurrentYear-1)&amp;nbsp; AND MAKEDATE((vCurrentYear-1) , 1, 1) &amp;gt;= MakeDate(2009, 1, 1) AND 2 = Ceil(MESE_DOC/3), W_TOT_IMP_RIGA_NETNET, 0)) &amp;lt;&amp;gt; 0, 1, 0)&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, when you activate the dimension in your table, the expressions (and not the totals) are calculated correctly. The expressions above return the correct values for all &lt;SPAN style="font-size: 13.3333px;"&gt;"D_AGENTE_DEST"; for F9 it correctly returns 3 while it returns 5 for all other &lt;SPAN style="font-size: 13.3333px;"&gt;"D_AGENTE_DEST". When QlikView evaluates the totals for the expression, the above will return 5 across the whole data set (i.e. every if statement returns true because, across the whole dataset, there are no gaps of "W_TOT_IMP_RIGA_NETNET" in any month; again, this happens because the &lt;SPAN style="font-size: 13.3333px;"&gt;"D_AGENTE_DEST" dimension is ignored when calculating the totals&lt;/SPAN&gt;). Which is incorrect because we know there is &lt;SPAN style="font-size: 13.3333px;"&gt;"D_AGENTE_DEST" whose result is 3 so the above should return something lower that 5.&lt;/SPAN&gt;&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;So, the solution, as stated by Stefan, is to introduce the aggregation; the total you were calculating before in your text box (1062.84) was actually incorrect&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;Hope it helps&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Feb 2018 14:01:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pivot-total-value-different-from-sum-of-rows-value/m-p/68126#M511656</guid>
      <dc:creator>lorenzoconforti</dc:creator>
      <dc:date>2018-02-15T14:01:53Z</dc:date>
    </item>
    <item>
      <title>Re: Pivot total value different from sum of rows value</title>
      <link>https://community.qlik.com/t5/QlikView/Pivot-total-value-different-from-sum-of-rows-value/m-p/68127#M511657</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply&lt;BR /&gt;I have just one doubt:&lt;/P&gt;&lt;P&gt;If I create pivot tables with different dimensions, I have to change the list of dimensions present in the aggr function for each pivot table? if I do so I will have on each pivot table total values different from the others?&lt;/P&gt;&lt;P&gt;Thanks again&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Feb 2018 14:49:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pivot-total-value-different-from-sum-of-rows-value/m-p/68127#M511657</guid>
      <dc:creator>paolojolly</dc:creator>
      <dc:date>2018-02-15T14:49:06Z</dc:date>
    </item>
    <item>
      <title>Re: Pivot total value different from sum of rows value</title>
      <link>https://community.qlik.com/t5/QlikView/Pivot-total-value-different-from-sum-of-rows-value/m-p/68128#M511658</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;"I have to change the list of dimensions present in the aggr function for each pivot table?" - I believe so; you would need to list the dimensions used&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;"if I do so I will have on each pivot table total values different from the others?" - the totals should be the same but your expressions are quite complex so you'll need to understand what extra dimensions you are bringing in and what impact it will have on the calculations. Take for example the division discussed before; that relies on the data being presented without "ANNO_DOC" or "MESE_DOC" as dimensions otherwise the denominator won't be calculated correctly. Probably you would need to test it to ensure you are getting the desired results&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Feb 2018 15:05:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pivot-total-value-different-from-sum-of-rows-value/m-p/68128#M511658</guid>
      <dc:creator>lorenzoconforti</dc:creator>
      <dc:date>2018-02-15T15:05:01Z</dc:date>
    </item>
  </channel>
</rss>

