<?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: Rolling Monthly Average - In Script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Rolling-Monthly-Average-In-Script/m-p/465507#M698463</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oleg thanks for responding, just as an example, the peek () function will help with the actual count/total for that day and the previous () would be to used to accumulate the count/total. Do you think you could provide some sample code?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks Again&lt;BR /&gt;Loren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 29 Jan 2013 15:20:02 GMT</pubDate>
    <dc:creator>lorenwood</dc:creator>
    <dc:date>2013-01-29T15:20:02Z</dc:date>
    <item>
      <title>Rolling Monthly Average - In Script</title>
      <link>https://community.qlik.com/t5/QlikView/Rolling-Monthly-Average-In-Script/m-p/465505#M698461</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone, I am trying to calculate the rolling average for the month (See attached file) (US Dollars to Euro)&lt;/P&gt;&lt;P&gt;so if day 1 the rate is 1.4000 and day 2 the rate is 1.4500 day 2 avg rate will be 1.4250.&amp;nbsp; for Day 3 and the rate is 1.4600 and rolling average will be 1.4366 etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will need to change starting with first day of the month, so on Jan 1, the average starts new.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not sure how to get this going in the script so any help provided would be great&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Jan 2013 22:26:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rolling-Monthly-Average-In-Script/m-p/465505#M698461</guid>
      <dc:creator>lorenwood</dc:creator>
      <dc:date>2013-01-28T22:26:40Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling Monthly Average - In Script</title>
      <link>https://community.qlik.com/t5/QlikView/Rolling-Monthly-Average-In-Script/m-p/465506#M698462</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'd recommend using Peek() and Previous() to accumulate rolling total and rolling count within each month (the average = rolling total/rolling count), and restart the total and the count every time the new month starts.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Jan 2013 23:28:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rolling-Monthly-Average-In-Script/m-p/465506#M698462</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2013-01-28T23:28:49Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling Monthly Average - In Script</title>
      <link>https://community.qlik.com/t5/QlikView/Rolling-Monthly-Average-In-Script/m-p/465507#M698463</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oleg thanks for responding, just as an example, the peek () function will help with the actual count/total for that day and the previous () would be to used to accumulate the count/total. Do you think you could provide some sample code?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks Again&lt;BR /&gt;Loren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jan 2013 15:20:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rolling-Monthly-Average-In-Script/m-p/465507#M698463</guid>
      <dc:creator>lorenwood</dc:creator>
      <dc:date>2013-01-29T15:20:02Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling Monthly Average - In Script</title>
      <link>https://community.qlik.com/t5/QlikView/Rolling-Monthly-Average-In-Script/m-p/465508#M698464</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Attached is a sample application using Oleg's suggestion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The script used is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;LOAD *, CumDailyRate/CumDayCount as CalcAvg;&lt;/P&gt;&lt;P&gt;LOAD *, if(CurrMonthKey = Previous(CurrMonthKey), RangeSum(DailyRate, Peek('CumDailyRate')), DailyRate) as CumDailyRate&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; , if(CurrMonthKey = Previous(CurrMonthKey), RangeSum(1, Peek('CumDayCount')), 1) as CumDayCount;&lt;/P&gt;&lt;P&gt;LOAD CurrMonthKey, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DailyRate, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AvgRollingMonthRate, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date&lt;/P&gt;&lt;P&gt;FROM &lt;SPAN style="font-size: 10pt;"&gt;RollingAvgExample.xlsx&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is Sheet1);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jan 2013 15:35:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rolling-Monthly-Average-In-Script/m-p/465508#M698464</guid>
      <dc:creator>nagaiank</dc:creator>
      <dc:date>2013-01-29T15:35:39Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling Monthly Average - In Script</title>
      <link>https://community.qlik.com/t5/QlikView/Rolling-Monthly-Average-In-Script/m-p/465509#M698465</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Kris, this works and helps me a lot&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jan 2013 16:10:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rolling-Monthly-Average-In-Script/m-p/465509#M698465</guid>
      <dc:creator>lorenwood</dc:creator>
      <dc:date>2013-01-29T16:10:13Z</dc:date>
    </item>
  </channel>
</rss>

