<?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 accumulated amount over the years using pivot table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Sum-accumulated-amount-over-the-years-using-pivot-table/m-p/831652#M1000639</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is this what you want?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/88428_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dimension F1 and Years&lt;/P&gt;&lt;P&gt;Expression: &lt;STRONG&gt;=If(Sum(Data) &amp;gt; 0, RangeSum(Before(Sum({&amp;lt;Years = &amp;gt;}Data), 0, ColumnNo())))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PFA the application for reference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Sunny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 04 Jun 2015 18:50:28 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2015-06-04T18:50:28Z</dc:date>
    <item>
      <title>Sum accumulated amount over the years using pivot table</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-accumulated-amount-over-the-years-using-pivot-table/m-p/831650#M1000637</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a pivot table with time dimension and trying to sum the accumulated amount for the selected year(s). The sum should take the selected max date and sum all the way back over the years taking into consideration the time dimension.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So let us say we have this data table:&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" jive-data-cell="{&amp;quot;color&amp;quot;:&amp;quot;#000000&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;left&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;2&amp;quot;}" jive-data-header="{&amp;quot;color&amp;quot;:&amp;quot;#FFFFFF&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;#6690BC&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;center&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;2&amp;quot;,&amp;quot;fontFamily&amp;quot;:&amp;quot;arial,helvetica,sans-serif&amp;quot;,&amp;quot;verticalAlign&amp;quot;:&amp;quot;baseline&amp;quot;}" style="border: 1px solid #000000; width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; color: #ffffff; padding: 2px; font-family: arial, helvetica, sans-serif; vertical-align: baseline; background-color: #6690bc;" valign="middle"&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;2011&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;2012&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;2013&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;2014&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;2015&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; color: #000000; text-align: left;"&gt;Cash&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;$100&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;$100&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;$100&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;$100&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;$100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; color: #000000; text-align: left;"&gt;Restricted Cash&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;$50&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;$50&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;$50&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;$50&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;$50&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So in case 2012, 2014 and 2015 are selected, the results in the pivot table should be:&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid #000000; width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;2012&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;2014&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;2015&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Cash&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;$200&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;$400&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;$500&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Restricted Cash&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;$100&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;$200&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;$250&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried these expressions but non have worked the way should:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;sum({1&amp;lt;[Transaction Date] = {"&amp;lt;=$(=max([Transaction Date]))"}&amp;gt;}[CASH])&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //(It ignores all the selected years and sums year-by-year)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;sum(TOTAL{$&amp;lt;[Transaction Date] = {"&amp;lt;=$(=max([Transaction Date]))"}&amp;gt;}[CASH])&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;sum(TOTAL{1&amp;lt;[Transaction Date] = {"&amp;lt;=$(=max([Transaction Date]))"}&amp;gt;}[CASH])&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;EM&gt;(same amount for the max year )&lt;/EM&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;sum(total{$&amp;lt;Year =, Month=,Quarter=,[Transaction Date] = {"&amp;lt;=$(=max([Transaction Date]))"}&amp;gt;}[CASH])&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help will be appreciated. Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Jun 2015 17:43:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-accumulated-amount-over-the-years-using-pivot-table/m-p/831650#M1000637</guid>
      <dc:creator />
      <dc:date>2015-06-04T17:43:29Z</dc:date>
    </item>
    <item>
      <title>Re: Sum accumulated amount over the years using pivot table</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-accumulated-amount-over-the-years-using-pivot-table/m-p/831651#M1000638</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you can use rangesum and before for this &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RangeSum(sum({&amp;lt;&lt;EM style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;[Transaction Date]&lt;/EM&gt;={"&amp;lt;=$(=max(&lt;EM style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;[Transaction Date]&lt;/EM&gt;))"}&amp;gt;}Cash),&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Before(sum({&amp;lt;&lt;EM style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;[Transaction Date]&lt;/EM&gt;={"&amp;lt;=$(=max(&lt;EM style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;[Transaction Date]&lt;/EM&gt;))"}&amp;gt;}Cash),0,ColumnNo())&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-blogpost/2787"&gt;Accumulative Sums&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Jun 2015 18:43:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-accumulated-amount-over-the-years-using-pivot-table/m-p/831651#M1000638</guid>
      <dc:creator>ramoncova06</dc:creator>
      <dc:date>2015-06-04T18:43:53Z</dc:date>
    </item>
    <item>
      <title>Re: Sum accumulated amount over the years using pivot table</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-accumulated-amount-over-the-years-using-pivot-table/m-p/831652#M1000639</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is this what you want?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/88428_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dimension F1 and Years&lt;/P&gt;&lt;P&gt;Expression: &lt;STRONG&gt;=If(Sum(Data) &amp;gt; 0, RangeSum(Before(Sum({&amp;lt;Years = &amp;gt;}Data), 0, ColumnNo())))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PFA the application for reference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Sunny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Jun 2015 18:50:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-accumulated-amount-over-the-years-using-pivot-table/m-p/831652#M1000639</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-06-04T18:50:28Z</dc:date>
    </item>
  </channel>
</rss>

