<?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 row by date range on Load Script? [QlikSense] in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Sum-row-by-date-range-on-Load-Script-QlikSense/m-p/1399018#M32474</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Bill, thanks for the reply,&amp;nbsp; The reason I'm trying to set it as static data in the load script, is that I have ~ 5-6 million rows , and didn't want to overly burden the front end dynamically calculating these figures.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a syntax for dimension from current cursor position vs overall range ? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like :&amp;nbsp; ( Sum ( if ( [date] &amp;lt; Current([date]), Amount )&amp;nbsp; ) &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 22 Sep 2017 14:25:40 GMT</pubDate>
    <dc:creator>johnnymartinez</dc:creator>
    <dc:date>2017-09-22T14:25:40Z</dc:date>
    <item>
      <title>Sum row by date range on Load Script? [QlikSense]</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-row-by-date-range-on-Load-Script-QlikSense/m-p/1399016#M32472</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there a way to do this? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically, add a column in the load script showing a sum of balance over current or previous dates per row?&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;In Excel, it'd be the formula in green, where it's the sum of the rows where the date is less/equal to the current cursor date: &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="example_ff.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/177455_example_ff.png" style="height: 180px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Sep 2017 13:27:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-row-by-date-range-on-Load-Script-QlikSense/m-p/1399016#M32472</guid>
      <dc:creator>johnnymartinez</dc:creator>
      <dc:date>2017-09-22T13:27:48Z</dc:date>
    </item>
    <item>
      <title>Re: Sum row by date range on Load Script? [QlikSense]</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-row-by-date-range-on-Load-Script-QlikSense/m-p/1399017#M32473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe use a Pivot Table in the front end and exploit subtotals.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could use Group By and Sum() in the load script, but that may well not be appropriate in your use case.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Sep 2017 14:20:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-row-by-date-range-on-Load-Script-QlikSense/m-p/1399017#M32473</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-22T14:20:17Z</dc:date>
    </item>
    <item>
      <title>Re: Sum row by date range on Load Script? [QlikSense]</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-row-by-date-range-on-Load-Script-QlikSense/m-p/1399018#M32474</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Bill, thanks for the reply,&amp;nbsp; The reason I'm trying to set it as static data in the load script, is that I have ~ 5-6 million rows , and didn't want to overly burden the front end dynamically calculating these figures.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a syntax for dimension from current cursor position vs overall range ? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like :&amp;nbsp; ( Sum ( if ( [date] &amp;lt; Current([date]), Amount )&amp;nbsp; ) &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Sep 2017 14:25:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-row-by-date-range-on-Load-Script-QlikSense/m-p/1399018#M32474</guid>
      <dc:creator>johnnymartinez</dc:creator>
      <dc:date>2017-09-22T14:25:40Z</dc:date>
    </item>
    <item>
      <title>Re: Sum row by date range on Load Script? [QlikSense]</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-row-by-date-range-on-Load-Script-QlikSense/m-p/1399019#M32475</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The running sum doens't appear to be picking up the prior amounts - for example - here's the chart in excel :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="r_sum2.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/178279_r_sum2.png" style="height: 260px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;and here's how it looks in Qlik :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="r_sum.png" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/178292_r_sum.png" style="height: 250px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's the code I am using, none seems to arrive at the totals I brought in as a static table from Excel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to have separate running sums for each fruit, by date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried doing it by date and by row numbers. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[CODE]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;fruit: &lt;/P&gt;&lt;P&gt;Load &lt;/P&gt;&lt;P&gt;date#(DATE,'DD/MM/YYYY') as [F_DATE],AMOUNT,PRODUCT,QTY,ROWNO() AS 'RW_NUM'&lt;/P&gt;&lt;P&gt; Inline&lt;/P&gt;&lt;P&gt; [&lt;/P&gt;&lt;P&gt;'DATE','AMOUNT','PRODUCT','QTY','RSUM','PROD_SUM','DATE_BALANCE',&lt;/P&gt;&lt;P&gt;'14/01/2017','3.2','PEAR','4','3.2','3.2','4.6',&lt;/P&gt;&lt;P&gt;'14/01/2017','0.9','APPLE','2','4.1','0.9','4.6',&lt;/P&gt;&lt;P&gt;'14/01/2017','0.1','CARROT','1','4.2','0.5','4.6',&lt;/P&gt;&lt;P&gt;'14/01/2017','0.4','CARROT','4','4.6','0.5','4.6',&lt;/P&gt;&lt;P&gt;'15/01/2017','0.9','APPLE','2','5.5','1.8','13',&lt;/P&gt;&lt;P&gt;'15/01/2017','4.8','PEAR','6','10.3','9.6','13',&lt;/P&gt;&lt;P&gt;'15/01/2017','0.5','ORANGE','2','10.8','0.5','13',&lt;/P&gt;&lt;P&gt;'15/01/2017','1.6','PEAR','2','12.4','9.6','13',&lt;/P&gt;&lt;P&gt;'15/01/2017','0.6','CARROT','6','13','1.1','13',&lt;/P&gt;&lt;P&gt;'16/01/2017','3','POTATO','3','16','3','16',&lt;/P&gt;&lt;P&gt;'17/01/2017','0.9','APPLE','2','16.9','2.7','20.1',&lt;/P&gt;&lt;P&gt;'17/01/2017','3.2','PEAR','4','20.1','12.8','20.1',&lt;/P&gt;&lt;P&gt;'18/01/2017','8.8','PEAR','11','28.9','21.6','28.9',&lt;/P&gt;&lt;P&gt;'19/01/2017','0.45','APPLE','1','29.35','3.15','29.65',&lt;/P&gt;&lt;P&gt;'19/01/2017','0.3','CARROT','3','29.65','1.4','29.65',&lt;/P&gt;&lt;P&gt;'20/01/2017','0.25','ORANGE','1','29.9','0.75','34.3',&lt;/P&gt;&lt;P&gt;'20/01/2017','0.4','CARROT','4','30.3','1.8','34.3',&lt;/P&gt;&lt;P&gt;'20/01/2017','4','PEAR','5','34.3','25.6','34.3',&lt;/P&gt;&lt;P&gt;'22/01/2017','0.1','CARROT','1','34.4','1.9','35.4',&lt;/P&gt;&lt;P&gt;'22/01/2017','1','POTATO','1','35.4','4','35.4',&lt;/P&gt;&lt;P&gt;'23/01/2017','0.9','APPLE','2','36.3','4.05','36.3',&lt;/P&gt;&lt;P&gt;'25/01/2017','2.5','PINEAPPLE','1','38.8','2.5','38.8',&lt;/P&gt;&lt;P&gt;'27/01/2017','4.8','PEAR','6','43.6','30.4','45',&lt;/P&gt;&lt;P&gt;'27/01/2017','0.9','APPLE','2','44.5','4.95','45',&lt;/P&gt;&lt;P&gt;'27/01/2017','0.5','ORANGE','2','45','1.25','45',&lt;/P&gt;&lt;P&gt;'29/01/2017','0.1','CARROT','1','45.1','2','45.1',&lt;/P&gt;&lt;P&gt;'31/01/2017','0.4','CARROT','4','45.5','2.4','45.5',&lt;/P&gt;&lt;P&gt;'01/02/2017','3','POTATO','3','48.5','7','48.5',&lt;/P&gt;&lt;P&gt;'02/02/2017','1.6','PEAR','2','50.1','32','50.7',&lt;/P&gt;&lt;P&gt;'02/02/2017','0.6','CARROT','6','50.7','3','50.7',&lt;/P&gt;&lt;P&gt;'03/02/2017','0.9','APPLE','2','51.6','5.85','51.6',&lt;/P&gt;&lt;P&gt;'05/02/2017','3.2','PEAR','4','54.8','35.2','54.8',&lt;/P&gt;&lt;P&gt;'07/02/2017','8.8','PEAR','11','63.6','44','63.6',&lt;/P&gt;&lt;P&gt;'08/02/2017','0.3','CARROT','3','63.9','3.8','68.4',&lt;/P&gt;&lt;P&gt;'08/02/2017','0.4','CARROT','4','64.3','3.8','68.4',&lt;/P&gt;&lt;P&gt;'08/02/2017','4','PEAR','5','68.3','48','68.4',&lt;/P&gt;&lt;P&gt;'08/02/2017','0.1','CARROT','1','68.4','3.8','68.4',&lt;/P&gt;&lt;P&gt;'09/02/2017','0.45','APPLE','1','68.85','6.3','70.1',&lt;/P&gt;&lt;P&gt;'09/02/2017','0.25','ORANGE','1','69.1','1.5','70.1',&lt;/P&gt;&lt;P&gt;'09/02/2017','1','POTATO','1','70.1','8','70.1'&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;POSI: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load * Inline [&lt;/P&gt;&lt;P&gt;'PRODUCT','SUM_TOTAL',&lt;/P&gt;&lt;P&gt;'APPLE','6.3',&lt;/P&gt;&lt;P&gt;'PEAR','48',&lt;/P&gt;&lt;P&gt;'ORANGE','1.5',&lt;/P&gt;&lt;P&gt;'CARROT','3.8',&lt;/P&gt;&lt;P&gt;'POTATO','8',&lt;/P&gt;&lt;P&gt;'PINEAPPLE','2.5'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[RSUM_ADD]:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;[F_DATE],num#([F_DATE]) as 'numdate',PRODUCT,&lt;/P&gt;&lt;P&gt;IF(PEEK(PRODUCT)=PRODUCT,PEEK(RSUM_Q)+QTY,QTY) AS RSUM_Q,&lt;/P&gt;&lt;P&gt;IF(PEEK(PRODUCT)=PRODUCT,PEEK(RSUM_A)+AMOUNT,AMOUNT) AS RSUM_A&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RESIDENT fruit&lt;/P&gt;&lt;P&gt;ORDER BY [F_DATE] DESC ,AMOUNT,PRODUCT,QTY;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TEST:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PRODUCT,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [F_DATE],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RangeSum (SUM(IF(PEEK(PRODUCT)=PRODUCT,AMOUNT))) AS 'RSUM_AMT_RNUM',&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RANGESUM(Sum(IF(PEEK(PRODUCT)=PRODUCT,AMOUNT)) + SUM(IF(PEEK(PRODUCT)=PRODUCT,PEEK(Cumulative_AMT),0))) AS Cumulative_AMT,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RANGESUM(Sum(IF(PEEK(PRODUCT)=PRODUCT,QTY)) + SUM(IF(PEEK(PRODUCT)=PRODUCT,PEEK(Cumulative_QTY),0)))&amp;nbsp;&amp;nbsp; AS Cumulative_QTY&lt;/P&gt;&lt;P&gt;Resident fruit&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GROUP BY&amp;nbsp; PRODUCT, [F_DATE]&lt;/P&gt;&lt;P&gt;ORDER BY [F_DATE] DESC ,AMOUNT,PRODUCT,QTY;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[/CODE]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Oct 2017 12:55:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-row-by-date-range-on-Load-Script-QlikSense/m-p/1399019#M32475</guid>
      <dc:creator>johnnymartinez</dc:creator>
      <dc:date>2017-10-02T12:55:15Z</dc:date>
    </item>
    <item>
      <title>Re: Sum row by date range on Load Script? [QlikSense]</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-row-by-date-range-on-Load-Script-QlikSense/m-p/1399020#M32476</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Has anyone successfully managed this yet, or is it best done in the SQL script instead?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jan 2018 09:38:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-row-by-date-range-on-Load-Script-QlikSense/m-p/1399020#M32476</guid>
      <dc:creator>johnnymartinez</dc:creator>
      <dc:date>2018-01-26T09:38:17Z</dc:date>
    </item>
  </channel>
</rss>

