<?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: Cumulative Sum in script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Cumulative-Sum-in-script/m-p/1014286#M640128</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes sorry, that's a typo. I just wrote the example in the text box. No error checking, sorry.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 29 Jan 2016 16:20:40 GMT</pubDate>
    <dc:creator>crystles</dc:creator>
    <dc:date>2016-01-29T16:20:40Z</dc:date>
    <item>
      <title>Cumulative Sum in script</title>
      <link>https://community.qlik.com/t5/QlikView/Cumulative-Sum-in-script/m-p/1014281#M640123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a table that lists Sales from Orders. It has many many variables, like Order Dates and Invoice Dates and other specifics about the Order and Shipping.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to get a cumulative sum of the items purchased by the Customer. However I can't seem to get it to work. There are thousands of records, but when I do a Sum(Sales) it outputs only like 4 Invoice Dates (key field) and 4 Sales amounts. When I do the Sum in the tables after loading the Script normally, it adds everything up correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not sure but I think I need RangeSum() and Peek() but I can't make them work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's an Example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SalesTable:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; CustomerID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Item,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; InvoiceDate,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; SalesAmt&lt;/P&gt;&lt;P&gt;From Sales.qvd;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SumSales:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; CustomerID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Item,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; InvoiceDate,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Sum(SalesAmt)&lt;/P&gt;&lt;P&gt;Resident SalesTable&lt;/P&gt;&lt;P&gt;Group By&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; CustomerID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Item,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; InvoiceDate,&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop Table SalesTable&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jan 2016 16:01:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cumulative-Sum-in-script/m-p/1014281#M640123</guid>
      <dc:creator>crystles</dc:creator>
      <dc:date>2016-01-29T16:01:58Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Sum in script</title>
      <link>https://community.qlik.com/t5/QlikView/Cumulative-Sum-in-script/m-p/1014282#M640124</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you share some data to test the code as well?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jan 2016 16:06:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cumulative-Sum-in-script/m-p/1014282#M640124</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-01-29T16:06:25Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Sum in script</title>
      <link>https://community.qlik.com/t5/QlikView/Cumulative-Sum-in-script/m-p/1014283#M640125</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The data table is very large... over 2 million records. I don't think I can post all of that here &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can give examples of field names and such? To give you a better idea?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jan 2016 16:07:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cumulative-Sum-in-script/m-p/1014283#M640125</guid>
      <dc:creator>crystles</dc:creator>
      <dc:date>2016-01-29T16:07:51Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Sum in script</title>
      <link>https://community.qlik.com/t5/QlikView/Cumulative-Sum-in-script/m-p/1014284#M640126</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The script you have posted looks ok per se, so your issue could well in your expressions / variables / visualizations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have also got a feeling that you may be able what you want in the dashboard as opposed to the script. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For posting a sample qvw, this Blog Post &lt;A href="https://community.qlik.com/docs/DOC-1290"&gt;Preparing examples for Upload - Reduction and Data Scrambling&lt;/A&gt; describes how reduce its size and scramble its data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;EDIT:&amp;nbsp; Except for the extra comma pointed out by Settu below.&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jan 2016 16:14:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cumulative-Sum-in-script/m-p/1014284#M640126</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-01-29T16:14:09Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Sum in script</title>
      <link>https://community.qlik.com/t5/QlikView/Cumulative-Sum-in-script/m-p/1014285#M640127</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;SPAN style="font-size: 13.3333px;"&gt;there is comma after Invoice date, Is that typo?&lt;/SPAN&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;crystles wrote:&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;SumSales:&lt;/P&gt;
&lt;P&gt;Load&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; CustomerID,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; Item,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; InvoiceDate,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; Sum(SalesAmt)&lt;/P&gt;
&lt;P&gt;Resident SalesTable&lt;/P&gt;
&lt;P&gt;Group By&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; CustomerID,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; Item,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; InvoiceDate&lt;STRONG&gt;,&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Drop Table SalesTable&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, 29 Jan 2016 16:17:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cumulative-Sum-in-script/m-p/1014285#M640127</guid>
      <dc:creator>settu_periasamy</dc:creator>
      <dc:date>2016-01-29T16:17:33Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Sum in script</title>
      <link>https://community.qlik.com/t5/QlikView/Cumulative-Sum-in-script/m-p/1014286#M640128</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes sorry, that's a typo. I just wrote the example in the text box. No error checking, sorry.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jan 2016 16:20:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cumulative-Sum-in-script/m-p/1014286#M640128</guid>
      <dc:creator>crystles</dc:creator>
      <dc:date>2016-01-29T16:20:40Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Sum in script</title>
      <link>https://community.qlik.com/t5/QlikView/Cumulative-Sum-in-script/m-p/1014287#M640129</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Would it be possible to get data for 2 customers for 4-5 items and 4-5 months? May be like 20-30 rows of data per customer? Is that doable?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jan 2016 16:38:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cumulative-Sum-in-script/m-p/1014287#M640129</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-01-29T16:38:55Z</dc:date>
    </item>
  </channel>
</rss>

