<?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: Sum / Subtotal of Rows in a Pivot Table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Sum-Subtotal-of-Rows-in-a-Pivot-Table/m-p/580504#M1116042</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I figured it out from an example posted by &lt;A href="https://community.qlik.com/qlik-users/26418"&gt;tresesco&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/message/414232"&gt;Re: Re: Conditional Subtotal of Pivot Table&lt;/A&gt;&lt;/P&gt;&lt;P&gt;...using "Show Partial Sums" at Instance level...&lt;/P&gt;&lt;P&gt;&lt;IMG alt="show partial sums.JPG.jpg" class="jive-image" src="/legacyfs/online/53130_show partial sums.JPG.jpg" style="width: 620px; height: 545px;" /&gt;&lt;/P&gt;&lt;P&gt;I was able to display the Average Instance size by Server (not the Sum of the Individual Instance sizes by Server like I wanted).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I realised though that this could be fixed by multiplying the Average by the Count of the Distinct Instance names. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i.e. replacing:&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13923025920103130" jivemacro_uid="_13923025920103130" modifiedtitle="true"&gt;
&lt;P&gt;( avg( {$&amp;lt;Service = {'Harmony'}, Role = {'Application Server'}, sub_Metric = {'Memory:Total Pool Bytes'} &amp;gt;} value) )/1024/1024/1024&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with:&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13923026176671444" jivemacro_uid="_13923026176671444"&gt;
&lt;P&gt;(( avg( {$&amp;lt;Service = {'Harmony'}, Role = {'Application Server'}, sub_Metric = {'Memory:Total Pool Bytes'} &amp;gt;} value) )/1024/1024/1024)*&lt;/P&gt;
&lt;P&gt;(Count({$&amp;lt;Service = {'Harmony'}, Role = {'Application Server'}, sub_Metric = {'Memory:Total Pool Bytes'} &amp;gt;}Distinct(Main_metric)))&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 13 Feb 2014 14:56:48 GMT</pubDate>
    <dc:creator>shane_spencer</dc:creator>
    <dc:date>2014-02-13T14:56:48Z</dc:date>
    <item>
      <title>Sum / Subtotal of Rows in a Pivot Table</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-Subtotal-of-Rows-in-a-Pivot-Table/m-p/580503#M1116041</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've got a pivot table that contains the Average size of numerous TM1 Instances on several Servers, by Date.&lt;/P&gt;&lt;P&gt;My raw data is take at 5 minute Intervals but for this pivot table I calculate the Average over the day.&lt;/P&gt;&lt;P&gt;i.e.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="figure1.JPG.jpg" class="jive-image" src="https://community.qlik.com/legacyfs/online/53096_figure1.JPG.jpg" style="width: 620px; height: 261px;" /&gt;&lt;/P&gt;&lt;P&gt;(At a pinch I could use Max instead of Average).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From these Averages, I'm trying to also calculate the Sub Total or Sum of the TM1 Instances size by Server, for each date.&lt;/P&gt;&lt;P&gt;i.e&lt;/P&gt;&lt;P&gt;&lt;IMG alt="figure2.JPG.jpg" class="jive-image" src="https://community.qlik.com/legacyfs/online/53097_figure2.JPG.jpg" style="width: 620px; height: 330px;" /&gt;&lt;/P&gt;&lt;P&gt;(At a pinch I'd settle for a seperate chart that shows Sub Totals only)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Doing some searching I thought this may be done via the Aggr function and found 2 pretty good posts from &lt;A href="https://community.qlik.com/qlik-users/2226"&gt;John Witherspoon&lt;/A&gt; , and &lt;A href="https://community.qlik.com/qlik-users/11057"&gt;Adam Bellerby&lt;/A&gt;. i.e.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/message/70711"&gt;Aggr Function&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/docs/DOC-3857"&gt;QlikView Technical Brief - AGGR.docx&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The I found another good contirbution by &lt;A href="https://community.qlik.com/qlik-users/4003"&gt;Henric Cronström&lt;/A&gt;, that suggests Aggr should NOT be used for this purpose.&lt;/P&gt;&lt;P&gt;&lt;A href="http://community.qlik.com/blogs/qlikviewdesignblog/2013/03/11/when-should-the-aggr-function-not-be-used" title="http://community.qlik.com/blogs/qlikviewdesignblog/2013/03/11/when-should-the-aggr-function-not-be-used"&gt;http://community.qlik.com/blogs/qlikviewdesignblog/2013/03/11/when-should-the-aggr-function-not-be-used&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So now I'm a bit confused. I've tried both methods but must admit that it's beyond me.&lt;/P&gt;&lt;P&gt;I've attached a much cut down version of my qvw in the hopes someone can help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;n.b. I've had to use Set Analysis that may seem redundant in the attached QVW but is needed to narrow down the data in the original QVW which is many times larger with dozens of Services and hundreds of Servers, Metrics and Submetrics.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Feb 2014 09:57:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-Subtotal-of-Rows-in-a-Pivot-Table/m-p/580503#M1116041</guid>
      <dc:creator>shane_spencer</dc:creator>
      <dc:date>2014-02-13T09:57:43Z</dc:date>
    </item>
    <item>
      <title>Re: Sum / Subtotal of Rows in a Pivot Table</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-Subtotal-of-Rows-in-a-Pivot-Table/m-p/580504#M1116042</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I figured it out from an example posted by &lt;A href="https://community.qlik.com/qlik-users/26418"&gt;tresesco&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/message/414232"&gt;Re: Re: Conditional Subtotal of Pivot Table&lt;/A&gt;&lt;/P&gt;&lt;P&gt;...using "Show Partial Sums" at Instance level...&lt;/P&gt;&lt;P&gt;&lt;IMG alt="show partial sums.JPG.jpg" class="jive-image" src="/legacyfs/online/53130_show partial sums.JPG.jpg" style="width: 620px; height: 545px;" /&gt;&lt;/P&gt;&lt;P&gt;I was able to display the Average Instance size by Server (not the Sum of the Individual Instance sizes by Server like I wanted).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I realised though that this could be fixed by multiplying the Average by the Count of the Distinct Instance names. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i.e. replacing:&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13923025920103130" jivemacro_uid="_13923025920103130" modifiedtitle="true"&gt;
&lt;P&gt;( avg( {$&amp;lt;Service = {'Harmony'}, Role = {'Application Server'}, sub_Metric = {'Memory:Total Pool Bytes'} &amp;gt;} value) )/1024/1024/1024&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with:&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13923026176671444" jivemacro_uid="_13923026176671444"&gt;
&lt;P&gt;(( avg( {$&amp;lt;Service = {'Harmony'}, Role = {'Application Server'}, sub_Metric = {'Memory:Total Pool Bytes'} &amp;gt;} value) )/1024/1024/1024)*&lt;/P&gt;
&lt;P&gt;(Count({$&amp;lt;Service = {'Harmony'}, Role = {'Application Server'}, sub_Metric = {'Memory:Total Pool Bytes'} &amp;gt;}Distinct(Main_metric)))&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Feb 2014 14:56:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-Subtotal-of-Rows-in-a-Pivot-Table/m-p/580504#M1116042</guid>
      <dc:creator>shane_spencer</dc:creator>
      <dc:date>2014-02-13T14:56:48Z</dc:date>
    </item>
  </channel>
</rss>

