<?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 Sub-Totals in Straight Table not adding up in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Sub-Totals-in-Straight-Table-not-adding-up/m-p/787668#M668434</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 straight table with sub-totals , however the sub-totals do not add up. &lt;/P&gt;&lt;P&gt;Attached herewith is an extract of my buying template which i exported to excel.&amp;nbsp;&amp;nbsp; The only column where the totals dont add up is the stock required column.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The formula for stock required is a follows:&lt;/P&gt;&lt;P&gt;if(Average Last 6 Months * No of Months - Stock on Hand &amp;lt; 0 ,0 , Average Last 6 Months * No of Months - Stock on Hand)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the expression tab , I have changed the "Total Mode" to Sum, however its still recognising it as a "Expression Total". &lt;/P&gt;&lt;P&gt;Also the Grand Total for this expression is also incorrect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I even changed the chart to pivot table and it still shows incorrect result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please can you help.&amp;nbsp; Do i need to change my formula for stock required.&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>Fri, 07 Nov 2014 07:17:50 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-11-07T07:17:50Z</dc:date>
    <item>
      <title>Sub-Totals in Straight Table not adding up</title>
      <link>https://community.qlik.com/t5/QlikView/Sub-Totals-in-Straight-Table-not-adding-up/m-p/787668#M668434</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 straight table with sub-totals , however the sub-totals do not add up. &lt;/P&gt;&lt;P&gt;Attached herewith is an extract of my buying template which i exported to excel.&amp;nbsp;&amp;nbsp; The only column where the totals dont add up is the stock required column.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The formula for stock required is a follows:&lt;/P&gt;&lt;P&gt;if(Average Last 6 Months * No of Months - Stock on Hand &amp;lt; 0 ,0 , Average Last 6 Months * No of Months - Stock on Hand)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the expression tab , I have changed the "Total Mode" to Sum, however its still recognising it as a "Expression Total". &lt;/P&gt;&lt;P&gt;Also the Grand Total for this expression is also incorrect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I even changed the chart to pivot table and it still shows incorrect result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please can you help.&amp;nbsp; Do i need to change my formula for stock required.&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>Fri, 07 Nov 2014 07:17:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sub-Totals-in-Straight-Table-not-adding-up/m-p/787668#M668434</guid>
      <dc:creator />
      <dc:date>2014-11-07T07:17:50Z</dc:date>
    </item>
    <item>
      <title>Re: Sub-Totals in Straight Table not adding up</title>
      <link>https://community.qlik.com/t5/QlikView/Sub-Totals-in-Straight-Table-not-adding-up/m-p/787669#M668435</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The problem is probably the use of the expression labels in the stock expression instead of the actual expressions themselves. Can you post the .qvw file?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Nov 2014 13:06:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sub-Totals-in-Straight-Table-not-adding-up/m-p/787669#M668435</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2014-11-07T13:06:27Z</dc:date>
    </item>
    <item>
      <title>Re: Sub-Totals in Straight Table not adding up</title>
      <link>https://community.qlik.com/t5/QlikView/Sub-Totals-in-Straight-Table-not-adding-up/m-p/787670#M668436</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gysbert&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Qlikivew model I have is huge .&amp;nbsp; What I'll do is make a condensed version and send it to you.&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>Fri, 07 Nov 2014 13:15:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sub-Totals-in-Straight-Table-not-adding-up/m-p/787670#M668436</guid>
      <dc:creator />
      <dc:date>2014-11-07T13:15:41Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Sub-Totals in Straight Table not adding up</title>
      <link>https://community.qlik.com/t5/QlikView/Sub-Totals-in-Straight-Table-not-adding-up/m-p/787671#M668437</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gysbert&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry for the delayed reply as i have been busy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attached herewith is the Sample Qlikview Model and an excel spreadhseet on which the Qlikview model is based on.&lt;/P&gt;&lt;P&gt;The Excel spreadheet has 2 sheet, one with Sales quantity and the other is Stock on Hand (SOH).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have added a new field called "MonthIndex" .&amp;nbsp; This is use so that it will enable me to calculate sales for the last few months.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As mentioned in my post, the sub-total &amp;amp; total of the stock required is incorrect. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanking you in advance.&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, 11 Nov 2014 09:08:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sub-Totals-in-Straight-Table-not-adding-up/m-p/787671#M668437</guid>
      <dc:creator />
      <dc:date>2014-11-11T09:08:59Z</dc:date>
    </item>
    <item>
      <title>Re: Sub-Totals in Straight Table not adding up</title>
      <link>https://community.qlik.com/t5/QlikView/Sub-Totals-in-Straight-Table-not-adding-up/m-p/787672#M668438</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gysbert&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I replied to you on Qlikview Community.  &lt;/P&gt;&lt;P&gt;&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;&lt;/P&gt;&lt;P&gt;Nayan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Nov 2014 09:12:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sub-Totals-in-Straight-Table-not-adding-up/m-p/787672#M668438</guid>
      <dc:creator />
      <dc:date>2014-11-11T09:12:42Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Re: Sub-Totals in Straight Table not adding up</title>
      <link>https://community.qlik.com/t5/QlikView/Sub-Totals-in-Straight-Table-not-adding-up/m-p/787673#M668439</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See attached qvw.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Nov 2014 09:20:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sub-Totals-in-Straight-Table-not-adding-up/m-p/787673#M668439</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2014-11-11T09:20:04Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Sub-Totals in Straight Table not adding up</title>
      <link>https://community.qlik.com/t5/QlikView/Sub-Totals-in-Straight-Table-not-adding-up/m-p/787674#M668440</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gysbert&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for the feedback.&amp;nbsp; Much appreciated. Can you explain the first path of formula.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt; &lt;/SPAN&gt;sum&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;aggr&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;rangemax&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(0,&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;$(vAvgLast6Months)&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;*&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;$(No of Months) &lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&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, 11 Nov 2014 09:28:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sub-Totals-in-Straight-Table-not-adding-up/m-p/787674#M668440</guid>
      <dc:creator />
      <dc:date>2014-11-11T09:28:35Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Sub-Totals in Straight Table not adding up</title>
      <link>https://community.qlik.com/t5/QlikView/Sub-Totals-in-Straight-Table-not-adding-up/m-p/787675#M668441</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;sum(aggr( &lt;EM&gt;...inner expression...&lt;/EM&gt; ,Branch,[Item Code]))&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;What this does is aggregate the values of the inner expression over the Branch and Item Code dimensions and sums those values. The aggr function creates a virtual table with the values of the inner expression calculated for each Branch and Item Code combination as 'records'. The outer sum then sums these values.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Nov 2014 09:35:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sub-Totals-in-Straight-Table-not-adding-up/m-p/787675#M668441</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2014-11-11T09:35:31Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Sub-Totals in Straight Table not adding up</title>
      <link>https://community.qlik.com/t5/QlikView/Sub-Totals-in-Straight-Table-not-adding-up/m-p/787676#M668442</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Gysbert.&amp;nbsp; Much appreciated.&amp;nbsp; Enjoy your day further.&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, 11 Nov 2014 09:37:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sub-Totals-in-Straight-Table-not-adding-up/m-p/787676#M668442</guid>
      <dc:creator />
      <dc:date>2014-11-11T09:37:54Z</dc:date>
    </item>
  </channel>
</rss>

