<?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 Totaling a column in a Pivot Table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Totaling-a-column-in-a-Pivot-Table/m-p/179054#M46040</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;John,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks so much for your response and for the explanation! The aggr() function is exactly what I needed and everything is working now.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 08 Jun 2010 14:26:40 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-06-08T14:26:40Z</dc:date>
    <item>
      <title>Totaling a column in a Pivot Table</title>
      <link>https://community.qlik.com/t5/QlikView/Totaling-a-column-in-a-Pivot-Table/m-p/179052#M46038</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm having a problem with summing a column in a pivot table. I use the following formula for the Actual Revenue column which works correctly for each line item:&lt;/P&gt;&lt;P&gt;If(StatusID='Firm',&lt;BR /&gt; sum((numJTDEstimatedSal) * 1.12) ,&lt;BR /&gt; sum(PostAmt * RevFlag)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;When you look at the subtotals or totals, only the status IDs &amp;lt;&amp;gt; 'Firm' are summed up. Sample data is listed below. Can anyone please tell me how I would go about getting the whole 'Actual Revenue' column to sum up correctly?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; width: 330pt;" width="440"&gt;&lt;COL style="width: 117pt;" width="156" /&gt;&lt;COL style="width: 59pt;" width="78" /&gt;&lt;COL style="width: 89pt;" width="119" /&gt;&lt;COL style="width: 65pt;" width="87" /&gt;&lt;TBODY&gt;&lt;TR height="17" style="height: 12.75pt;"&gt;&lt;TD class="xl22" height="17" style="height: 12.75pt; width: 117pt;" width="156"&gt;&lt;/TD&gt;&lt;TD class="xl28" style="border-left: medium none; width: 59pt;" width="78"&gt;Status&lt;/TD&gt;&lt;TD class="xl23" style="width: 89pt;" width="119" str="Estimated Revenue "&gt;Estimated Revenue&lt;/TD&gt;&lt;TD class="xl23" style="border-left: medium none; width: 65pt;" width="87"&gt;Actual Revenue&lt;/TD&gt;&lt;/TR&gt;&lt;TR height="17" style="height: 12.75pt;"&gt;&lt;TD class="xl23" height="17" style="height: 12.75pt; border-top: medium none;"&gt;&lt;/TD&gt;&lt;TD class="xl23" style="border-top: medium none; border-left: medium none;"&gt;Billable&lt;/TD&gt;&lt;TD align="right" class="xl24" style="border-top: medium none; border-left: medium none;" num="57235.27"&gt;$57,235.27&lt;/TD&gt;&lt;TD align="right" class="xl24" style="border-top: medium none; border-left: medium none;" num="57233.27"&gt;$57,233.27&lt;/TD&gt;&lt;/TR&gt;&lt;TR height="17" style="height: 12.75pt;"&gt;&lt;TD class="xl23" height="17" style="height: 12.75pt; border-top: medium none;"&gt;&lt;/TD&gt;&lt;TD class="xl23" style="border-top: medium none; border-left: medium none;"&gt;Billable&lt;/TD&gt;&lt;TD align="right" class="xl24" style="border-top: medium none; border-left: medium none;" num="30504.26"&gt;$30,504.26&lt;/TD&gt;&lt;TD align="right" class="xl24" style="border-top: medium none; border-left: medium none;" num="29105.26"&gt;$29,105.26&lt;/TD&gt;&lt;/TR&gt;&lt;TR height="17" style="height: 12.75pt;"&gt;&lt;TD class="xl23" height="17" style="height: 12.75pt; border-top: medium none;"&gt;&lt;/TD&gt;&lt;TD class="xl23" style="border-top: medium none; border-left: medium none;"&gt;Billable&lt;/TD&gt;&lt;TD align="right" class="xl24" style="border-top: medium none; border-left: medium none;" num="10524"&gt;$10,524.00&lt;/TD&gt;&lt;TD align="right" class="xl24" style="border-top: medium none; border-left: medium none;" num="10524"&gt;$10,524.00&lt;/TD&gt;&lt;/TR&gt;&lt;TR height="17" style="height: 12.75pt;"&gt;&lt;TD class="xl23" height="17" style="height: 12.75pt; border-top: medium none;"&gt;&lt;/TD&gt;&lt;TD class="xl23" style="border-top: medium none; border-left: medium none;"&gt;Billable&lt;/TD&gt;&lt;TD align="right" class="xl24" style="border-top: medium none; border-left: medium none;" num="60101.4"&gt;$60,101.40&lt;/TD&gt;&lt;TD align="right" class="xl24" style="border-top: medium none; border-left: medium none;" num="0"&gt;$0.00&lt;/TD&gt;&lt;/TR&gt;&lt;TR height="17" style="height: 12.75pt;"&gt;&lt;TD class="xl23" height="17" style="height: 12.75pt; border-top: medium none;"&gt;&lt;/TD&gt;&lt;TD class="xl23" style="border-top: medium none; border-left: medium none;"&gt;Billable&lt;/TD&gt;&lt;TD align="right" class="xl24" style="border-top: medium none; border-left: medium none;" num="1396"&gt;$1,396.00&lt;/TD&gt;&lt;TD align="right" class="xl24" style="border-top: medium none; border-left: medium none;" num="0"&gt;$0.00&lt;/TD&gt;&lt;/TR&gt;&lt;TR height="17" style="height: 12.75pt;"&gt;&lt;TD class="xl23" height="17" style="height: 12.75pt; border-top: medium none;"&gt;&lt;/TD&gt;&lt;TD class="xl23" style="border-top: medium none; border-left: medium none;"&gt;Firm&lt;/TD&gt;&lt;TD align="right" class="xl24" style="border-top: medium none; border-left: medium none;" num="51272"&gt;$51,272.00&lt;/TD&gt;&lt;TD align="right" class="xl24" style="border-top: medium none; border-left: medium none;" num="57424.639999999999"&gt;$57,424.64&lt;/TD&gt;&lt;/TR&gt;&lt;TR height="17" style="height: 12.75pt;"&gt;&lt;TD class="xl23" height="17" style="height: 12.75pt; border-top: medium none;"&gt;&lt;/TD&gt;&lt;TD class="xl23" style="border-top: medium none; border-left: medium none;"&gt;Firm&lt;/TD&gt;&lt;TD align="right" class="xl24" style="border-top: medium none; border-left: medium none;" num="24000"&gt;$24,000.00&lt;/TD&gt;&lt;TD align="right" class="xl24" style="border-top: medium none; border-left: medium none;" num="26880"&gt;$26,880.00&lt;/TD&gt;&lt;/TR&gt;&lt;TR height="17" style="height: 12.75pt;"&gt;&lt;TD class="xl23" height="17" style="height: 12.75pt; border-top: medium none;"&gt;&lt;/TD&gt;&lt;TD class="xl23" style="border-top: medium none; border-left: medium none;"&gt;Firm&lt;/TD&gt;&lt;TD align="right" class="xl24" style="border-top: medium none; border-left: medium none;" num="39000"&gt;$39,000.00&lt;/TD&gt;&lt;TD align="right" class="xl24" style="border-top: medium none; border-left: medium none;" num="43680"&gt;$43,680.00&lt;/TD&gt;&lt;/TR&gt;&lt;TR height="17" style="height: 12.75pt;"&gt;&lt;TD class="xl25" height="17" style="height: 12.75pt; border-top: medium none;"&gt;&lt;/TD&gt;&lt;TD class="xl26" style="border-top: medium none;"&gt;Total&lt;/TD&gt;&lt;TD align="right" class="xl27" style="border-top: medium none; border-left: medium none;" num="274032.93"&gt;$274,032.93&lt;/TD&gt;&lt;TD align="right" class="xl27" style="border-top: medium none; border-left: medium none;" num="96862.53"&gt;$96,862.53&lt;/TD&gt;&lt;/TR&gt;&lt;TR height="17" style="height: 12.75pt;"&gt;&lt;TD class="xl25" height="17" style="height: 12.75pt; border-top: medium none;"&gt;Total&lt;/TD&gt;&lt;TD class="xl26" style="border-top: medium none;"&gt;&lt;/TD&gt;&lt;TD align="right" class="xl27" style="border-top: medium none; border-left: medium none;" num="274032.93"&gt;274,032.93&lt;/TD&gt;&lt;TD align="right" class="xl27" style="border-top: medium none; border-left: medium none;" num="96862.53"&gt;&lt;P&gt;$96,862.53&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jun 2010 21:33:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Totaling-a-column-in-a-Pivot-Table/m-p/179052#M46038</guid>
      <dc:creator />
      <dc:date>2010-06-07T21:33:12Z</dc:date>
    </item>
    <item>
      <title>Totaling a column in a Pivot Table</title>
      <link>https://community.qlik.com/t5/QlikView/Totaling-a-column-in-a-Pivot-Table/m-p/179053#M46039</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Pivot tables always evaluate the expression for the total instead of summing the rows. On the total line, the StatusID has TWO values, not one, so evaluates to null in your comparison, giving you the else value. So your total line is probably sum(PostAmt * RevFlag)?&lt;/P&gt;&lt;P&gt;To do a sum of rows in a pivot table, you use aggr(). The basic form is this:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;sum(aggr(your expression, your dimensions))&lt;/P&gt;&lt;P&gt;So in your case, something like this if I'm understanding your pivot table:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;sum(aggr(If(StatusID='Firm',&lt;BR /&gt; sum((numJTDEstimatedSal) * 1.12) ,&lt;BR /&gt; sum(PostAmt * RevFlag)&lt;BR /&gt; ),StatusID))&lt;/P&gt;&lt;P&gt;I think you can find more information under "advanced aggregation" in the help text.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jun 2010 01:04:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Totaling-a-column-in-a-Pivot-Table/m-p/179053#M46039</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2010-06-08T01:04:35Z</dc:date>
    </item>
    <item>
      <title>Totaling a column in a Pivot Table</title>
      <link>https://community.qlik.com/t5/QlikView/Totaling-a-column-in-a-Pivot-Table/m-p/179054#M46040</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;John,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks so much for your response and for the explanation! The aggr() function is exactly what I needed and everything is working now.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jun 2010 14:26:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Totaling-a-column-in-a-Pivot-Table/m-p/179054#M46040</guid>
      <dc:creator />
      <dc:date>2010-06-08T14:26:40Z</dc:date>
    </item>
  </channel>
</rss>

