<?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 Calculate &amp;quot;Rolling average&amp;quot; in script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calculate-quot-Rolling-average-quot-in-script/m-p/324386#M707206</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi both,&lt;/P&gt;&lt;P&gt;Interesting - right now I´m having a look at your suggestions and will get back later, hopefully today.&lt;/P&gt;&lt;P&gt;Thanks for sharing &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Feb 2012 10:09:22 GMT</pubDate>
    <dc:creator>jstensig</dc:creator>
    <dc:date>2012-02-28T10:09:22Z</dc:date>
    <item>
      <title>Calculate "Rolling average" in script</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-quot-Rolling-average-quot-in-script/m-p/324383#M707200</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I´m doing some investigation on our Purchase-transactiondata and need to calculate a 3 month Rolling average per ProductID to identify "bad data" / outliers.&lt;/P&gt;&lt;P&gt;The reason for trying to do it in the load script, is 1) that I have millions of records and 2) hoping to do some automation in the process of handling the "bad data" / outliers.&lt;/P&gt;&lt;P&gt;I know that I can do something similar in Chart expressions, but finding it very hard to identify and handle "bad data" / outliers using Charts = a lot of manual work &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/sad.png" /&gt;&lt;/P&gt;&lt;P&gt;Any ideas out there?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Feb 2012 08:54:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-quot-Rolling-average-quot-in-script/m-p/324383#M707200</guid>
      <dc:creator>jstensig</dc:creator>
      <dc:date>2012-02-28T08:54:45Z</dc:date>
    </item>
    <item>
      <title>Calculate "Rolling average" in script</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-quot-Rolling-average-quot-in-script/m-p/324384#M707202</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would suggest following structur:&lt;/P&gt;&lt;P&gt;load&lt;/P&gt;&lt;P&gt;sum(value) as Sumvalue&lt;/P&gt;&lt;P&gt;year/period&lt;/P&gt;&lt;P&gt;ProductID&lt;/P&gt;&lt;P&gt;resident your data group by year/period, ProductID where not bad data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then &lt;/P&gt;&lt;P&gt;give your year/period a number, oder by year / period&lt;/P&gt;&lt;P&gt;eg 201101=1, 201102 = 2, 201111=11, 201112=12, 201201=13, 201202=14 and so on.&lt;/P&gt;&lt;P&gt;Then calculate in a loop &lt;/P&gt;&lt;P&gt;sum(Sumvalue)&lt;/P&gt;&lt;P&gt;year/period&lt;/P&gt;&lt;P&gt;ProductID&lt;/P&gt;&lt;P&gt;resident Sumtable group by year/period, ProductID where periodnumber &amp;lt;= loop -3&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 Feb 2012 09:18:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-quot-Rolling-average-quot-in-script/m-p/324384#M707202</guid>
      <dc:creator>martinpohl</dc:creator>
      <dc:date>2012-02-28T09:18:26Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate "Rolling average" in script</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-quot-Rolling-average-quot-in-script/m-p/324385#M707204</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; hi check the attach example &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Feb 2012 09:48:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-quot-Rolling-average-quot-in-script/m-p/324385#M707204</guid>
      <dc:creator>lironbaram</dc:creator>
      <dc:date>2012-02-28T09:48:40Z</dc:date>
    </item>
    <item>
      <title>Calculate "Rolling average" in script</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-quot-Rolling-average-quot-in-script/m-p/324386#M707206</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi both,&lt;/P&gt;&lt;P&gt;Interesting - right now I´m having a look at your suggestions and will get back later, hopefully today.&lt;/P&gt;&lt;P&gt;Thanks for sharing &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Feb 2012 10:09:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-quot-Rolling-average-quot-in-script/m-p/324386#M707206</guid>
      <dc:creator>jstensig</dc:creator>
      <dc:date>2012-02-28T10:09:22Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate "Rolling average" in script</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-quot-Rolling-average-quot-in-script/m-p/324387#M707207</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi Martin,&lt;BR /&gt;You pointed me in the right direction - ended up with a 2-step solution using WHILE and IterNo() for ordinary load and afterwards aggregation&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;// Loading each purchase-line up to 3 times (WHILE-syntax) and "moving" DeliveryMonth (DeliveryMonth_new) accordingly&lt;BR /&gt;PurchaseLines_3mth:&lt;BR /&gt;LOAD ProductID,Amount,Cost&lt;BR /&gt; ,AddMonths(DeliveryMonth,IterNo()-1) AS DeliveryMonth_new&lt;BR /&gt;Resident PurchaseLines&lt;BR /&gt;while AddMonths(AddMonths(DeliveryMonth,-2),IterNo()-1) &amp;lt;= DeliveryMonth&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;// Aggregate by ProductID,DeliveryMonth_new&lt;BR /&gt;PurchaseLines_aggr:&lt;BR /&gt;NoConcatenate&lt;BR /&gt;LOAD &lt;BR /&gt; ProductID,DeliveryMonth_new&lt;BR /&gt; ,Sum(Amount) AS AmtTotal3mth,Sum(Cost) AS CostTotal3mth,Count(ProductID) AS LinesTotal3mth&lt;BR /&gt;Resident PurchaseLines_3mth&lt;BR /&gt;Group BY ProductID,DeliveryMonth_new;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Drop table PurchaseLines_3mth;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The aggregated data is joined back on transactiondata and used for further calculations&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Feb 2012 09:49:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-quot-Rolling-average-quot-in-script/m-p/324387#M707207</guid>
      <dc:creator>jstensig</dc:creator>
      <dc:date>2012-02-29T09:49:32Z</dc:date>
    </item>
    <item>
      <title>Calculate "Rolling average" in script</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-quot-Rolling-average-quot-in-script/m-p/324388#M707208</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi liron,&lt;BR /&gt;Thanks for mentioning the RangeAvg-function - I can use that in further calculations in my project&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Feb 2012 09:52:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-quot-Rolling-average-quot-in-script/m-p/324388#M707208</guid>
      <dc:creator>jstensig</dc:creator>
      <dc:date>2012-02-29T09:52:46Z</dc:date>
    </item>
  </channel>
</rss>

