<?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 Accumulation on scripting in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Accumulation-on-scripting/m-p/358310#M132986</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ALL,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me regarding the following requirement which I want to achieve through script&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please find the attched file for the dummy data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I click on Year 2011 and Month Jan ... I want the data for Jan 2011&lt;/P&gt;&lt;P&gt;when I select Month Feb... I want data for Jan &amp;amp; Feb... like wise for Mar.. I want data for jan, feb &amp;amp; Mar.. and so on.&lt;/P&gt;&lt;P&gt;Same I want for the year 2012 also.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 18 May 2012 09:42:40 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-05-18T09:42:40Z</dc:date>
    <item>
      <title>Accumulation on scripting</title>
      <link>https://community.qlik.com/t5/QlikView/Accumulation-on-scripting/m-p/358310#M132986</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ALL,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me regarding the following requirement which I want to achieve through script&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please find the attched file for the dummy data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I click on Year 2011 and Month Jan ... I want the data for Jan 2011&lt;/P&gt;&lt;P&gt;when I select Month Feb... I want data for Jan &amp;amp; Feb... like wise for Mar.. I want data for jan, feb &amp;amp; Mar.. and so on.&lt;/P&gt;&lt;P&gt;Same I want for the year 2012 also.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 May 2012 09:42:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Accumulation-on-scripting/m-p/358310#M132986</guid>
      <dc:creator />
      <dc:date>2012-05-18T09:42:40Z</dc:date>
    </item>
    <item>
      <title>Re: Accumulation on scripting</title>
      <link>https://community.qlik.com/t5/QlikView/Accumulation-on-scripting/m-p/358311#M132987</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333px;"&gt;Try this (to be modified for your situation)&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14653209224912787 jive_text_macro" jivemacro_uid="_14653209224912787"&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;// assumption: data is on level of %CATEG1_KEY, %CATEG2_KEY, Year, Month&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LOAD&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; *,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; If(Year = Peek('Year', -1) AND // if year of current record = year of pevious record and&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; %CATEG1_KEY = Peek('%CATEG1_KEY', -1) AND // if same %CATEG1_KEY as previous record and&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %CATEG2_KEY = Peek('%CATEG2_KEY', -1), // if same %CATEG2_KEY as previous record&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; RangeSum(Peek('Sales_Acc', -1), Sales), // previous month + current month&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; RangeSum(Sales)) // use only first month of new year&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; AS Sales_Acc&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Resident Sales&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;ORDER BY %CATEG1_KEY, %CATEG2_KEY, Year, Month; // order records by all categories (%CATEG1_KEY, %CATEG1_KEY), Year and Month to use peek function for accumulation&lt;/SPAN&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px; font-family: arial, helvetica, sans-serif;"&gt;If this helps you please mark it as helpful or correct.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px; font-family: arial, helvetica, sans-serif;"&gt;Thomas&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px; font-family: arial, helvetica, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jun 2016 17:35:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Accumulation-on-scripting/m-p/358311#M132987</guid>
      <dc:creator>thkarner</dc:creator>
      <dc:date>2016-06-07T17:35:30Z</dc:date>
    </item>
    <item>
      <title>Re: Accumulation on scripting</title>
      <link>https://community.qlik.com/t5/QlikView/Accumulation-on-scripting/m-p/358312#M132988</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;See the example attaching here.&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, 07 Jun 2016 21:23:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Accumulation-on-scripting/m-p/358312#M132988</guid>
      <dc:creator>spividori</dc:creator>
      <dc:date>2016-06-07T21:23:31Z</dc:date>
    </item>
  </channel>
</rss>

