<?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 Running Total in Script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Running-Total-in-Script/m-p/228231#M80284</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Got it...&lt;/P&gt;&lt;P&gt;IF("cam_FinancialYear" = Previous("cam_FinancialYear"), ("cam_BudgetedDays" + Peek('cam_BudgetedDaysCumulative')), "cam_BudgetedDays") AS cam_BudgetedDaysCumulative,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 20 Dec 2010 16:32:15 GMT</pubDate>
    <dc:creator>pkelly</dc:creator>
    <dc:date>2010-12-20T16:32:15Z</dc:date>
    <item>
      <title>Running Total in Script</title>
      <link>https://community.qlik.com/t5/QlikView/Running-Total-in-Script/m-p/228229#M80282</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am pulling information in from our trading system and want to create a field which equates to running total of budgeted days.&lt;/P&gt;&lt;P&gt;In the first period of the financial year, this will equal the first period thereafter it will start to accumulate until a new financial year is met.&lt;/P&gt;&lt;P&gt;From previous posts, I have come up with the routine below....&lt;/P&gt;&lt;P&gt;I am not getting the cumulative figure only the working days for the first period in the year.&lt;/P&gt;&lt;P&gt;Monthly:&lt;BR /&gt;LOAD *,&lt;BR /&gt; IF("cam_FinancialYear" = Previous("cam_FinancialYear"), ("cam_BudgetedDays" + Peek('cam_BudgetedDaysCumulative',-1,'Monthly')), cam_BudgetedDays") AS cam_BudgetedDaysCumulative;&lt;/P&gt;&lt;P&gt;LOAD&lt;BR /&gt; UPPER(Code) AS %AnalysisPeriodKey,&lt;BR /&gt; UPPER(Code) AS cam_AnalysisPeriod,&lt;BR /&gt; "Code-Desc" AS cam_MonthYear,&lt;BR /&gt; value1 AS cam_FinancialYear,&lt;BR /&gt; Value2 AS cam_MonthNumber,&lt;BR /&gt; Value3 AS cam_BudgetedDays,&lt;BR /&gt;&lt;BR /&gt; sequence AS cam_YearQuarter,&lt;BR /&gt; IF(active = 0, 'No', 'Yes') AS cam_Active;&lt;BR /&gt;SQL SELECT *&lt;BR /&gt;FROM PUB."cde_codes"&lt;BR /&gt;WHERE Prefix = 'ZFINPERIOD'&lt;BR /&gt;AND Code &amp;gt;='$(varFromAnalysisPeriod)';&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Dec 2010 15:52:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Running-Total-in-Script/m-p/228229#M80282</guid>
      <dc:creator>pkelly</dc:creator>
      <dc:date>2010-12-20T15:52:07Z</dc:date>
    </item>
    <item>
      <title>Running Total in Script</title>
      <link>https://community.qlik.com/t5/QlikView/Running-Total-in-Script/m-p/228230#M80283</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Now I am totally confused...&lt;/P&gt;&lt;P&gt;I changed my script by adding the following line after the cam_BudgetedDaysCumulative statement (was trying a suggestion from a different post keeping my original intact)..&lt;/P&gt;&lt;P&gt;If("cam_FinancialYear" = Previous("cam_FinancialYear"), RangeSum(cam_BudgetedDays, Peek('cam_BudgetedDays')),cam_BudgetedDays) AS Cumulative;&lt;/P&gt;&lt;P&gt;My cam_BudgetedDaysCumulative column is now calculating properly?&lt;/P&gt;&lt;P&gt;The "Cumulative" field result is this month and previous month added together.&lt;/P&gt;&lt;P&gt;Why does the introduction of this new field cause the cam_BudgetedDaysCumulative to work?&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Dec 2010 16:14:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Running-Total-in-Script/m-p/228230#M80283</guid>
      <dc:creator>pkelly</dc:creator>
      <dc:date>2010-12-20T16:14:38Z</dc:date>
    </item>
    <item>
      <title>Running Total in Script</title>
      <link>https://community.qlik.com/t5/QlikView/Running-Total-in-Script/m-p/228231#M80284</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Got it...&lt;/P&gt;&lt;P&gt;IF("cam_FinancialYear" = Previous("cam_FinancialYear"), ("cam_BudgetedDays" + Peek('cam_BudgetedDaysCumulative')), "cam_BudgetedDays") AS cam_BudgetedDaysCumulative,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Dec 2010 16:32:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Running-Total-in-Script/m-p/228231#M80284</guid>
      <dc:creator>pkelly</dc:creator>
      <dc:date>2010-12-20T16:32:15Z</dc:date>
    </item>
  </channel>
</rss>

