<?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: Total does not add up in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Total-does-not-add-up/m-p/560676#M691027</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=If(RowNo() = 0 or IsNull(RowNo()), Sum(if(Average*7-[Stock on Hand]+[Sales Order]&amp;lt;0,0,Average*7-[Stock on Hand]+[Sales Order])),&lt;/P&gt;&lt;P&gt;if(Average*7-[Stock on Hand]+[Sales Order]&amp;lt;0,0,Average*7-[Stock on Hand]+[Sales Order]))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 15 Oct 2013 10:27:41 GMT</pubDate>
    <dc:creator>MayilVahanan</dc:creator>
    <dc:date>2013-10-15T10:27:41Z</dc:date>
    <item>
      <title>Total does not add up</title>
      <link>https://community.qlik.com/t5/QlikView/Total-does-not-add-up/m-p/560675#M691024</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a problem with a &lt;SPAN style="text-decoration: underline;"&gt;pivot table&lt;/SPAN&gt; where the total do not add up. &lt;/P&gt;&lt;P&gt;I have a buying template and want to calculate the stock required which is&amp;nbsp; (if negative , give zero): &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Average&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;*7-&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Stock on Hand]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;+&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Sales Order]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;lt;0,0,&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Average&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;*7-&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Stock on Hand]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;+&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Sales Order]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) .&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;The only problem im having is that &lt;SPAN style="text-decoration: underline;"&gt;total of the "stock required"&lt;/SPAN&gt;&amp;nbsp; is incorrect.&amp;nbsp; The total should be 10,697 and not 9768.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;im aware that the solution works for a straight table.&amp;nbsp; I want it to work for a pivot table.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;I have attached the Qlikview Model as well as the data (in excel)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Please can you help.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;kind regards&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Nayan&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Oct 2013 10:17:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Total-does-not-add-up/m-p/560675#M691024</guid>
      <dc:creator />
      <dc:date>2013-10-15T10:17:04Z</dc:date>
    </item>
    <item>
      <title>Re: Total does not add up</title>
      <link>https://community.qlik.com/t5/QlikView/Total-does-not-add-up/m-p/560676#M691027</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=If(RowNo() = 0 or IsNull(RowNo()), Sum(if(Average*7-[Stock on Hand]+[Sales Order]&amp;lt;0,0,Average*7-[Stock on Hand]+[Sales Order])),&lt;/P&gt;&lt;P&gt;if(Average*7-[Stock on Hand]+[Sales Order]&amp;lt;0,0,Average*7-[Stock on Hand]+[Sales Order]))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Oct 2013 10:27:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Total-does-not-add-up/m-p/560676#M691027</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2013-10-15T10:27:41Z</dc:date>
    </item>
    <item>
      <title>Re: Total does not add up</title>
      <link>https://community.qlik.com/t5/QlikView/Total-does-not-add-up/m-p/560677#M691029</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;PFA&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Oct 2013 10:31:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Total-does-not-add-up/m-p/560677#M691029</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2013-10-15T10:31:34Z</dc:date>
    </item>
    <item>
      <title>Re: Total does not add up</title>
      <link>https://community.qlik.com/t5/QlikView/Total-does-not-add-up/m-p/560678#M691031</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can look into the method&lt;/P&gt;&lt;P&gt;Sum of rows in pivot tables using adavanced aggregation&lt;/P&gt;&lt;P&gt;in the Help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will look like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum( aggr(&lt;/P&gt;&lt;P&gt;if(Average*7-[Stock on Hand]+[Sales Order]&amp;lt;0,0,Average*7-[Stock on Hand]+[Sales Order])&lt;/P&gt;&lt;P&gt;,[Component Code],[ITEM&amp;nbsp; CODE]))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for your expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Probably there is even an easier solution.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Oct 2013 10:32:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Total-does-not-add-up/m-p/560678#M691031</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2013-10-15T10:32:19Z</dc:date>
    </item>
    <item>
      <title>Re: Total does not add up</title>
      <link>https://community.qlik.com/t5/QlikView/Total-does-not-add-up/m-p/560679#M691033</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for the responses.&amp;nbsp; It works on the QV Template given.&amp;nbsp; I'm going to try it out on my actual model and will let all know regarding the outcome.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;kind regards&lt;/P&gt;&lt;P&gt;Nayan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Oct 2013 10:43:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Total-does-not-add-up/m-p/560679#M691033</guid>
      <dc:creator />
      <dc:date>2013-10-15T10:43:24Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Total does not add up</title>
      <link>https://community.qlik.com/t5/QlikView/Total-does-not-add-up/m-p/560680#M691035</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mayil&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your formula works.&lt;/P&gt;&lt;P&gt;However , if i use the heading names in the stock required , the formula does not work.&amp;nbsp; (see model attached).&lt;/P&gt;&lt;P&gt;Can you tell me why?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I change the names of the headings of the 3 columns :&lt;/P&gt;&lt;P&gt;ie&amp;nbsp; Average&amp;nbsp; = NewAVG&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Stock on Hand = NewSOH&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sales Order = NewSO&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my actual buying temple, each of the columns is a complex if formula, hence i use the name of the headings in my stock required formla.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;kind regards&lt;/P&gt;&lt;P&gt;Nayan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Oct 2013 11:42:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Total-does-not-add-up/m-p/560680#M691035</guid>
      <dc:creator />
      <dc:date>2013-10-15T11:42:27Z</dc:date>
    </item>
  </channel>
</rss>

