<?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: Accumulative sum for two dimensions in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Accumulative-sum-for-two-dimensions/m-p/914475#M468886</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It worked! Thanks so much! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 07 Aug 2015 18:26:10 GMT</pubDate>
    <dc:creator>jdmarlin</dc:creator>
    <dc:date>2015-08-07T18:26:10Z</dc:date>
    <item>
      <title>Accumulative sum for two dimensions</title>
      <link>https://community.qlik.com/t5/QlikView/Accumulative-sum-for-two-dimensions/m-p/914469#M468880</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Greetings! &lt;SPAN class="emoticon-inline emoticon_happy" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;In this example we're trying to accumulate market values, '&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #800000;"&gt;MV',&lt;/SPAN&gt; by '&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #800000;"&gt;Period&lt;/SPAN&gt;' (January to December, or last month of the year) and '&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #800000;"&gt;Region'&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;, (A, B, C, or D), and then graph the results in a line chart.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;Using &lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit; color: #0000ff;"&gt;RangeSum&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit; color: #0000ff;"&gt;Above&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit; color: #0000ff;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit; color: #800000;"&gt;MV&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;),0,&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit; color: #800000;"&gt;Month&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;)) produces the correct results when the pivot table is collapsed to the '&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333320617676px; font-family: inherit; color: #800000;"&gt;Period&lt;/SPAN&gt;' dimension, but once you expand the pivot table to &lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333320617676px; font-family: inherit; color: #800000;"&gt;'Region&lt;/SPAN&gt;' the formula breaks.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;We can mimic the correct results by dragging the '&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #800000;"&gt;Region&lt;/SPAN&gt;' dimension across the top and using the previous&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #0000ff;"&gt;RangeSum()&lt;/SPAN&gt; formula. But once you convert this pivot table to a line chart the accumulation is lost.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;tl;dr&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Accumulate market values from January to December (or last month of the year), and break it up by region.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Thanks!&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;JDM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2015 20:11:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Accumulative-sum-for-two-dimensions/m-p/914469#M468880</guid>
      <dc:creator>jdmarlin</dc:creator>
      <dc:date>2015-08-06T20:11:29Z</dc:date>
    </item>
    <item>
      <title>Re: Accumulative sum for two dimensions</title>
      <link>https://community.qlik.com/t5/QlikView/Accumulative-sum-for-two-dimensions/m-p/914470#M468881</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Like this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to take care that Period is sorted chronological in load order (like in your sample data) to make this solution using advanced aggregation work with your real data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2015 22:32:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Accumulative-sum-for-two-dimensions/m-p/914470#M468881</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2015-08-06T22:32:19Z</dc:date>
    </item>
    <item>
      <title>Re: Accumulative sum for two dimensions</title>
      <link>https://community.qlik.com/t5/QlikView/Accumulative-sum-for-two-dimensions/m-p/914471#M468882</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hope you are looking for something like this..&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/95278_Capture.PNG" style="height: 602px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Aug 2015 00:59:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Accumulative-sum-for-two-dimensions/m-p/914471#M468882</guid>
      <dc:creator>prabhu0505</dc:creator>
      <dc:date>2015-08-07T00:59:27Z</dc:date>
    </item>
    <item>
      <title>Re: Accumulative sum for two dimensions</title>
      <link>https://community.qlik.com/t5/QlikView/Accumulative-sum-for-two-dimensions/m-p/914472#M468883</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi swuehl!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your response. It works in the sample data, but not in my real data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've sorted Period and Region in the load script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;Activity_2:&lt;/P&gt;
&lt;P&gt;NoConcatenate LOAD&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PERIOD,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MONTH,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; YEAR,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ACTIVITY,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PERCENTAGE,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; COUNTRY,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; NAME,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DIVISION,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; REGION&lt;/P&gt;
&lt;P&gt;Resident Activity_1 Order by PERIOD, REGION;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;DROP Table Activity_1;&lt;/P&gt;


&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when I apply the aggr formula the data breaks again:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;Aggr(RangeSum(Above(Sum(ACTIVITY * PERCENTAGE/100),0,MONTH)),REGION,PERIOD)&lt;/P&gt;


&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Aug 2015 14:57:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Accumulative-sum-for-two-dimensions/m-p/914472#M468883</guid>
      <dc:creator>jdmarlin</dc:creator>
      <dc:date>2015-08-07T14:57:51Z</dc:date>
    </item>
    <item>
      <title>Re: Accumulative sum for two dimensions</title>
      <link>https://community.qlik.com/t5/QlikView/Accumulative-sum-for-two-dimensions/m-p/914473#M468884</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your reply! The sum should cumulate by region and year. So for example in March 2011: Region A should have a value of 28 (22+4+2) , Region B should have 25, and so on &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Aug 2015 14:59:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Accumulative-sum-for-two-dimensions/m-p/914473#M468884</guid>
      <dc:creator>jdmarlin</dc:creator>
      <dc:date>2015-08-07T14:59:44Z</dc:date>
    </item>
    <item>
      <title>Re: Accumulative sum for two dimensions</title>
      <link>https://community.qlik.com/t5/QlikView/Accumulative-sum-for-two-dimensions/m-p/914474#M468885</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortunately, you won't change LOAD order of a field if you do something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;T1:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD Field&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;FROM Source;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;NOCONCATENATE &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD Field&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;RESIDENT T1&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;ORDER BY Field;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;DROP TABLE T1;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you LOAD Field the second time, the load order of the field will still be determined by the first load (It's not about the order of values in the table, but in the field).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to do something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create a temporary table with Period values ordered chronological first in your script, something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Tmp&lt;/EM&gt;:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MonthName(AddMonths(Makedate(2011), recno()-1) ) as Period&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Autogenerate 36;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then LOAD your data:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD Period, &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; Month(Period) as Month,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; Year(Period) as Year,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Region, &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MV&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;FROM&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;C&gt;&lt;/C&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;(biff, embedded labels, table is Sheet1$);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;Then drop the temp table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;DROP TABLE Tmp;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Aug 2015 16:10:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Accumulative-sum-for-two-dimensions/m-p/914474#M468885</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2015-08-07T16:10:37Z</dc:date>
    </item>
    <item>
      <title>Re: Accumulative sum for two dimensions</title>
      <link>https://community.qlik.com/t5/QlikView/Accumulative-sum-for-two-dimensions/m-p/914475#M468886</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It worked! Thanks so much! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Aug 2015 18:26:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Accumulative-sum-for-two-dimensions/m-p/914475#M468886</guid>
      <dc:creator>jdmarlin</dc:creator>
      <dc:date>2015-08-07T18:26:10Z</dc:date>
    </item>
  </channel>
</rss>

