<?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: Need help with accumulation formula in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Need-help-with-accumulation-formula/m-p/249523#M500064</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;According to your requirement, the following should work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;RangeSum(Above(Sum(Amount), 0, RowNo()))&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/people/mabaeyens" style="font-size: 12px; outline-style: none; padding-top: 1px; padding-bottom: 1px; padding-left: 17px; color: #007fc0; zoom: 1; background-position: no-repeat no-repeat;"&gt;Miguel Angel Baeyens&lt;/A&gt;&lt;/P&gt;&lt;P&gt;BI Consultant&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://www.grupocomex.com/" style="font-size: 12px; outline-style: none; color: #007fc0;"&gt;Comex Grupo Ibérica&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 01 Jun 2011 07:23:30 GMT</pubDate>
    <dc:creator>Miguel_Angel_Baeyens</dc:creator>
    <dc:date>2011-06-01T07:23:30Z</dc:date>
    <item>
      <title>Need help with accumulation formula</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-with-accumulation-formula/m-p/249519#M500060</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Qlik-Experts!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need help with a certain accumulation formula.&lt;/P&gt;&lt;P&gt;I have to accumulate booking amounts over the years in a pivot table. With some search in the community I found a formula which works when the last dimension in the pivot table is the booking year, but not when other dimensions are placed after the year.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please find a simplified sample of my problem attached. The formula I am using right now is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;= if(rowno(),rangesum(sum(Amount&amp;nbsp; ) , above(sum(Amount) ,1,rowno())),sum( Amount ) )&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And I have problems to adapt it in a way, that it is somehow fixed to the year dimension.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is much appreciated!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 May 2011 08:08:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-help-with-accumulation-formula/m-p/249519#M500060</guid>
      <dc:creator />
      <dc:date>2011-05-30T08:08:04Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with accumulation formula</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-with-accumulation-formula/m-p/249520#M500061</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;aggregate the whole expression per Year field:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt; =aggr( if(rowno(),rangesum(sum(Amount&amp;nbsp; ) , above( sum(Amount) ,1,rowno())),sum( Amount ) ) ,Year) &lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps!&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 May 2011 08:19:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-help-with-accumulation-formula/m-p/249520#M500061</guid>
      <dc:creator />
      <dc:date>2011-05-30T08:19:23Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with accumulation formula</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-with-accumulation-formula/m-p/249521#M500062</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay, works so far for aggregation over the years no matter which dimension is else in the pivot table.&lt;/P&gt;&lt;P&gt;Thank you so far!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I figured out I need to change&amp;nbsp; the description of the requirement a bit.&lt;/P&gt;&lt;P&gt;I need to aggregate over the years but only for the dimension which come after the year.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So if the original data looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 199px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="17" width="56"&gt;%Key1&lt;/TD&gt;&lt;TD class="xl63" style="border-left: medium none;" width="30"&gt;Year&lt;/TD&gt;&lt;TD class="xl63" style="border-left: medium none;" width="70"&gt;SalesRep&lt;/TD&gt;&lt;TD class="xl63" style="border-left: medium none;" width="43"&gt;Amount&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: medium none;"&gt;A&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top: medium none; border-left: medium none;"&gt;2008&lt;/TD&gt;&lt;TD class="xl64" style="border-top: medium none; border-left: medium none;"&gt;Mary&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top: medium none; border-left: medium none;"&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: medium none;"&gt;A&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top: medium none; border-left: medium none;"&gt;2009&lt;/TD&gt;&lt;TD class="xl64" style="border-top: medium none; border-left: medium none;"&gt;Mary&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top: medium none; border-left: medium none;"&gt;200&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: medium none;"&gt;B&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top: medium none; border-left: medium none;"&gt;2008&lt;/TD&gt;&lt;TD class="xl64" style="border-top: medium none; border-left: medium none;"&gt;Joe&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top: medium none; border-left: medium none;"&gt;500&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: medium none;"&gt;B&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top: medium none; border-left: medium none;"&gt;2009&lt;/TD&gt;&lt;TD class="xl64" style="border-top: medium none; border-left: medium none;"&gt;Joe&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top: medium none; border-left: medium none;"&gt;400&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would need the output like this (accumulated over the year but still a drilldown through the dimensions in the pivot)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Year&amp;nbsp; SalesRep&amp;nbsp; Amount&lt;/P&gt;&lt;P&gt;2008&amp;nbsp; Mary&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 100&lt;/P&gt;&lt;P&gt;2009&amp;nbsp; Mary&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 300&lt;/P&gt;&lt;P&gt;2008&amp;nbsp; Joe&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 500&lt;/P&gt;&lt;P&gt;2009&amp;nbsp; Joe&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 900&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The expression from Steve gives me:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="257"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="17" width="61"&gt;Year&lt;/TD&gt;&lt;TD class="xl64" style="border-left: medium none;" width="98"&gt;SalesRep&lt;/TD&gt;&lt;TD class="xl65" width="98"&gt;Amount&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl65" height="17" style="border-top: medium none;"&gt;2008&lt;/TD&gt;&lt;TD class="xl65" style="border-top: medium none; border-left: medium none;"&gt;Mary&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: medium none; border-left: medium none;"&gt;600&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl65" height="17" style="border-top: medium none;"&gt;2009&lt;/TD&gt;&lt;TD class="xl65" style="border-top: medium none; border-left: medium none;"&gt;Mary&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: medium none; border-left: medium none;"&gt;1200&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 May 2011 08:05:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-help-with-accumulation-formula/m-p/249521#M500062</guid>
      <dc:creator />
      <dc:date>2011-05-31T08:05:05Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with accumulation formula</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-with-accumulation-formula/m-p/249522#M500063</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 was unable to make the requested chart wthout modify the data a bit. The change is that every row has unique %Key1 field based on Year&amp;amp;SalesRep combination. The modify table look like this bolow:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="3" cellspacing="0" class="jiveBorder" height="114" style="width: 381px; height: 24px; border-width: 1px; border-color: #000000; border-style: solid;" width="379"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;%Key1&lt;BR /&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;Year&lt;BR /&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;SalesRep&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Amount&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;2008&lt;/TD&gt;&lt;TD&gt;Mary&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;2008&lt;/TD&gt;&lt;TD&gt;Joe&lt;/TD&gt;&lt;TD&gt;500&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;2009&lt;/TD&gt;&lt;TD&gt;Mary&lt;/TD&gt;&lt;TD&gt;200&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;D&lt;/TD&gt;&lt;TD&gt;2009&lt;/TD&gt;&lt;TD&gt;Joe&lt;/TD&gt;&lt;TD&gt;400&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And the expression is:&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;aggr( rangesum( sum(Amount), above(sum(Amount),1,rowno())) ,%Key1)&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also the sort of the SalesRep must be on %Key1 field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With this changes the result table is:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="kumul test.png" class="jive-image" src="https://community.qlik.com/legacyfs/online/4866_kumul+test.png" /&gt;&lt;/P&gt;&lt;P&gt;If no unique key is availabe in the datasource you can always use the Autonumber number function to make unique key based on a field combination.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jun 2011 06:29:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-help-with-accumulation-formula/m-p/249522#M500063</guid>
      <dc:creator />
      <dc:date>2011-06-01T06:29:37Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with accumulation formula</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-with-accumulation-formula/m-p/249523#M500064</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;According to your requirement, the following should work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;RangeSum(Above(Sum(Amount), 0, RowNo()))&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/people/mabaeyens" style="font-size: 12px; outline-style: none; padding-top: 1px; padding-bottom: 1px; padding-left: 17px; color: #007fc0; zoom: 1; background-position: no-repeat no-repeat;"&gt;Miguel Angel Baeyens&lt;/A&gt;&lt;/P&gt;&lt;P&gt;BI Consultant&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://www.grupocomex.com/" style="font-size: 12px; outline-style: none; color: #007fc0;"&gt;Comex Grupo Ibérica&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jun 2011 07:23:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-help-with-accumulation-formula/m-p/249523#M500064</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-06-01T07:23:30Z</dc:date>
    </item>
  </channel>
</rss>

