<?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 total in script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Cumulative-total-in-script/m-p/710890#M256054</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please see the attached&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Oct 2014 12:24:00 GMT</pubDate>
    <dc:creator>Kushal_Chawda</dc:creator>
    <dc:date>2014-10-28T12:24:00Z</dc:date>
    <item>
      <title>Cumulative total in script</title>
      <link>https://community.qlik.com/t5/QlikView/Cumulative-total-in-script/m-p/710884#M256048</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 am trying to get the cumulative sales by Booking Date per Service Month.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please see below ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="548"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl67" height="17" width="170"&gt;Service Month&lt;/TD&gt;&lt;TD class="xl68" style="border-left: none;" width="118"&gt;Booking Date&lt;/TD&gt;&lt;TD class="xl68" style="border-left: none;" width="117"&gt;Sales&lt;/TD&gt;&lt;TD class="xl68" style="border-left: none;" width="143"&gt;Cumulative Sales&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl69" height="17" style="border-top: none;"&gt;Jul-14&lt;/TD&gt;&lt;TD align="right" class="xl81" style="border-top: none; border-left: none;"&gt;2014-01-15&lt;/TD&gt;&lt;TD align="right" class="xl93" style="border-top: none; border-left: none;"&gt;851&lt;/TD&gt;&lt;TD align="right" class="xl93" style="border-top: none; border-left: none;"&gt;851&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl70" height="17"&gt;Jul-14&lt;/TD&gt;&lt;TD align="right" class="xl82" style="border-left: none;"&gt;2014-02-01&lt;/TD&gt;&lt;TD align="right" class="xl94" style="border-left: none;"&gt;100&lt;/TD&gt;&lt;TD align="right" class="xl94" style="border-left: none;"&gt;951&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl70" height="17"&gt;Jul-14&lt;/TD&gt;&lt;TD align="right" class="xl82" style="border-left: none;"&gt;2014-04-10&lt;/TD&gt;&lt;TD align="right" class="xl94" style="border-left: none;"&gt;150&lt;/TD&gt;&lt;TD align="right" class="xl94" style="border-left: none;"&gt;1101&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl70" height="17"&gt;Jul-14&lt;/TD&gt;&lt;TD align="right" class="xl82" style="border-left: none;"&gt;2014-07-15&lt;/TD&gt;&lt;TD align="right" class="xl94" style="border-left: none;"&gt;292&lt;/TD&gt;&lt;TD align="right" class="xl94" style="border-left: none;"&gt;1393&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl71" height="17"&gt;Jul-14&lt;/TD&gt;&lt;TD align="right" class="xl83" style="border-left: none;"&gt;2014-07-18&lt;/TD&gt;&lt;TD align="right" class="xl95" style="border-left: none;"&gt;356&lt;/TD&gt;&lt;TD align="right" class="xl95" style="border-left: none;"&gt;1749&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl72" height="17" style="border-top: none;"&gt;Aug-14&lt;/TD&gt;&lt;TD align="right" class="xl84" style="border-top: none; border-left: none;"&gt;2014-03-23&lt;/TD&gt;&lt;TD align="right" class="xl96" style="border-top: none; border-left: none;"&gt;659&lt;/TD&gt;&lt;TD align="right" class="xl96" style="border-top: none; border-left: none;"&gt;659&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl73" height="17"&gt;Aug-14&lt;/TD&gt;&lt;TD align="right" class="xl85" style="border-left: none;"&gt;2014-08-23&lt;/TD&gt;&lt;TD align="right" class="xl97" style="border-left: none;"&gt;784&lt;/TD&gt;&lt;TD align="right" class="xl97" style="border-left: none;"&gt;1443&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl73" height="17"&gt;Aug-14&lt;/TD&gt;&lt;TD align="right" class="xl85" style="border-left: none;"&gt;2014-08-25&lt;/TD&gt;&lt;TD align="right" class="xl97" style="border-left: none;"&gt;254&lt;/TD&gt;&lt;TD align="right" class="xl97" style="border-left: none;"&gt;1697&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl74" height="17"&gt;Aug-14&lt;/TD&gt;&lt;TD align="right" class="xl86" style="border-left: none;"&gt;2014-08-28&lt;/TD&gt;&lt;TD align="right" class="xl98" style="border-left: none;"&gt;169&lt;/TD&gt;&lt;TD align="right" class="xl98" style="border-left: none;"&gt;1866&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl75" height="17" style="border-top: none;"&gt;Sep-14&lt;/TD&gt;&lt;TD align="right" class="xl87" style="border-top: none; border-left: none;"&gt;2014-04-19&lt;/TD&gt;&lt;TD align="right" class="xl99" style="border-top: none; border-left: none;"&gt;32&lt;/TD&gt;&lt;TD align="right" class="xl99" style="border-top: none; border-left: none;"&gt;32&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl76" height="17"&gt;Sep-14&lt;/TD&gt;&lt;TD align="right" class="xl88" style="border-left: none;"&gt;2014-05-12&lt;/TD&gt;&lt;TD align="right" class="xl100" style="border-left: none;"&gt;524&lt;/TD&gt;&lt;TD align="right" class="xl100" style="border-left: none;"&gt;556&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl76" height="17"&gt;Sep-14&lt;/TD&gt;&lt;TD align="right" class="xl88" style="border-left: none;"&gt;2014-05-28&lt;/TD&gt;&lt;TD align="right" class="xl100" style="border-left: none;"&gt;94&lt;/TD&gt;&lt;TD align="right" class="xl100" style="border-left: none;"&gt;650&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl76" height="17"&gt;Sep-14&lt;/TD&gt;&lt;TD align="right" class="xl88" style="border-left: none;"&gt;2014-08-09&lt;/TD&gt;&lt;TD align="right" class="xl100" style="border-left: none;"&gt;863&lt;/TD&gt;&lt;TD align="right" class="xl100" style="border-left: none;"&gt;1513&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl77" height="17"&gt;Sep-14&lt;/TD&gt;&lt;TD align="right" class="xl89" style="border-left: none;"&gt;2014-09-21&lt;/TD&gt;&lt;TD align="right" class="xl101" style="border-left: none;"&gt;97&lt;/TD&gt;&lt;TD align="right" class="xl101" style="border-left: none;"&gt;1610&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl78" height="17" style="border-top: none;"&gt;Oct-14&lt;/TD&gt;&lt;TD align="right" class="xl90" style="border-top: none; border-left: none;"&gt;2014-10-01&lt;/TD&gt;&lt;TD align="right" class="xl102" style="border-top: none; border-left: none;"&gt;899&lt;/TD&gt;&lt;TD align="right" class="xl102" style="border-top: none; border-left: none;"&gt;899&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl79" height="17"&gt;Oct-14&lt;/TD&gt;&lt;TD align="right" class="xl91" style="border-left: none;"&gt;2014-10-13&lt;/TD&gt;&lt;TD align="right" class="xl103" style="border-left: none;"&gt;966&lt;/TD&gt;&lt;TD align="right" class="xl103" style="border-left: none;"&gt;1865&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl80" height="17"&gt;Oct-14&lt;/TD&gt;&lt;TD align="right" class="xl92" style="border-left: none;"&gt;2014-10-16&lt;/TD&gt;&lt;TD align="right" class="xl104" style="border-left: none;"&gt;444&lt;/TD&gt;&lt;TD align="right" class="xl104" style="border-left: none;"&gt;2309&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What i want to achieve is column 'Cumulative Sales'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions will be appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Magen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Oct 2014 12:08:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cumulative-total-in-script/m-p/710884#M256048</guid>
      <dc:creator />
      <dc:date>2014-10-28T12:08:02Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative total in script</title>
      <link>https://community.qlik.com/t5/QlikView/Cumulative-total-in-script/m-p/710885#M256049</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;in your script put&lt;/P&gt;&lt;P&gt;Load * , if(rowno()=1, sales, sales + peek(&lt;SPAN style="font-size: 13.63636302948px;"&gt;CumulativeSales&lt;/SPAN&gt;) as CumulativeSales&lt;/P&gt;&lt;P&gt;resident table;&lt;/P&gt;&lt;P&gt;of course you need to sort the table by date first&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Oct 2014 12:14:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cumulative-total-in-script/m-p/710885#M256049</guid>
      <dc:creator>ali_hijazi</dc:creator>
      <dc:date>2014-10-28T12:14:42Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative total in script</title>
      <link>https://community.qlik.com/t5/QlikView/Cumulative-total-in-script/m-p/710886#M256050</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;RANGESUM ( SUM(Sales )ABOVE ( SUM( Sales ), 1, ROWNO() ) )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Oct 2014 12:16:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cumulative-total-in-script/m-p/710886#M256050</guid>
      <dc:creator>sorrakis01</dc:creator>
      <dc:date>2014-10-28T12:16:58Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative total in script</title>
      <link>https://community.qlik.com/t5/QlikView/Cumulative-total-in-script/m-p/710887#M256051</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Initial:&lt;/P&gt;&lt;P&gt;Load ServiceMonth,Date#(BookingDate,'YYYY-MM-DD') As BookingDate,Sales Inline [&lt;/P&gt;&lt;P&gt;ServiceMonth,BookingDate,Sales&lt;/P&gt;&lt;P&gt;Jul-14,2014-01-15,851&lt;/P&gt;&lt;P&gt;Jul-14,2014-02-01,100&lt;/P&gt;&lt;P&gt;Jul-14,2014-04-10,150&lt;/P&gt;&lt;P&gt;Jul-14,2014-07-15,292&lt;/P&gt;&lt;P&gt;Jul-14,2014-07-18,356&lt;/P&gt;&lt;P&gt;Aug-14,2014-03-23,659&lt;/P&gt;&lt;P&gt;Aug-14,2014-08-23,784&lt;/P&gt;&lt;P&gt;Aug-14,2014-08-25,254&lt;/P&gt;&lt;P&gt;Aug-14,2014-08-28,169 ];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Join&lt;/P&gt;&lt;P&gt;Load ServiceMonth,BookingDate,If(ServiceMonth &amp;lt;&amp;gt; Previous(ServiceMonth),Sales,Sales+Peek(CumSum)) As CumSum Resident Initial Order by ServiceMonth,BookingDate;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Oct 2014 12:18:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cumulative-total-in-script/m-p/710887#M256051</guid>
      <dc:creator>anbu1984</dc:creator>
      <dc:date>2014-10-28T12:18:46Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative total in script</title>
      <link>https://community.qlik.com/t5/QlikView/Cumulative-total-in-script/m-p/710888#M256052</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You want something like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First. Load the table from file. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table1:&lt;BR /&gt;Load &lt;/P&gt;&lt;P&gt;[Service Month],&lt;/P&gt;&lt;P&gt;[Booking Date],&lt;/P&gt;&lt;P&gt;Sales,&lt;/P&gt;&lt;P&gt;0 as [&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Cumulative Sales]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;from File1.qvd(qvd);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you load it resident. This is because you can not use the Order by clause on a load from file:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Noconcatenate&lt;/P&gt;&lt;P&gt;Table2:&lt;/P&gt;&lt;P&gt;load &lt;/P&gt;&lt;P&gt;[Service Month],&lt;/P&gt;&lt;P&gt;[Booking Date]&lt;/P&gt;&lt;P&gt;Sales,&lt;/P&gt;&lt;P&gt;if(Previous([Service Month]) = [Service Month], Previous([&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Cumulative Sales])+Sales,Sales) as [&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Cumulative Sales]&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;resident Table1 &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Order by [Service Month] asc, [Booking Date] asc;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;drop table Table1;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Oct 2014 12:19:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cumulative-total-in-script/m-p/710888#M256052</guid>
      <dc:creator>simenkg</dc:creator>
      <dc:date>2014-10-28T12:19:56Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative total in script</title>
      <link>https://community.qlik.com/t5/QlikView/Cumulative-total-in-script/m-p/710889#M256053</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;PRE __default_attr="sql" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14144992439362297" jivemacro_uid="_14144992439362297"&gt;
&lt;P&gt;Temp:&lt;/P&gt;
&lt;P&gt;LOAD date(date#([Service Month],'MMM-YY')) as [Service Month], &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Booking Date], &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sales &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //[Cumulative Sales]&lt;/P&gt;
&lt;P&gt;FROM&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;A class="jive-link-thread-small" data-containerid="2051" data-containertype="14" data-objectid="139746" data-objecttype="1" href="http://community.qlik.com/thread/139746"&gt;http://community.qlik.com/thread/139746&lt;/A&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;(html, codepage is 1252, embedded labels, table is @1);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;[Final]:&amp;nbsp; &lt;/P&gt;
&lt;P&gt;LOAD&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp; *,&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; IF([Service Month] = Previous([Service Month]), RangeSum([Sales], Peek('Cumulative Sales')),[Sales]) AS [Cumulative Sales] &lt;/P&gt;
&lt;P&gt;Resident Temp Order By [Service Month],[Booking Date] ASC;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;DROP Table Temp;&amp;nbsp; &lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;ASHFAQ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Oct 2014 12:21:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cumulative-total-in-script/m-p/710889#M256053</guid>
      <dc:creator>ashfaq_haseeb</dc:creator>
      <dc:date>2014-10-28T12:21:25Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative total in script</title>
      <link>https://community.qlik.com/t5/QlikView/Cumulative-total-in-script/m-p/710890#M256054</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please see the attached&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Oct 2014 12:24:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cumulative-total-in-script/m-p/710890#M256054</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2014-10-28T12:24:00Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative total in script</title>
      <link>https://community.qlik.com/t5/QlikView/Cumulative-total-in-script/m-p/710891#M256055</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;Load *,numsum(Sales+ peek([Cumm Sales])) as [Cumm Sales]&lt;/P&gt;&lt;P&gt;resident Table;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Oct 2014 12:26:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cumulative-total-in-script/m-p/710891#M256055</guid>
      <dc:creator />
      <dc:date>2014-10-28T12:26:14Z</dc:date>
    </item>
  </channel>
</rss>

