<?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 30-days Average in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Rolling-30-days-Average/m-p/1434569#M810047</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;LOAD Date,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [File Name],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [File Size]&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;[Sample2.xlsx]&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is Sheet1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;join (Data)&lt;/P&gt;&lt;P&gt;LOAD Date as Date1&lt;/P&gt;&lt;P&gt;Resident Data;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;New:&lt;/P&gt;&lt;P&gt;LOAD *,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(Flag=1 and Previous(Flag)=0,[File Size],if(Previous(Flag)=1 and Flag&amp;lt;&amp;gt;0,rangesum([File Size],Peek('AccumFileSize')))) as AccumFileSize;&lt;/P&gt;&lt;P&gt;LOAD *,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(Date1-Date&amp;lt;=30 and Date1-Date&amp;gt;=0,1,0) as Flag&lt;/P&gt;&lt;P&gt;Resident Data&lt;/P&gt;&lt;P&gt;Order by Date1,Date;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP Table Data;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Left Join(New)&lt;/P&gt;&lt;P&gt;LOAD Sum(Flag) as DateCount,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date1&lt;/P&gt;&lt;P&gt;Resident New&lt;/P&gt;&lt;P&gt;Group by Date1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Final:&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;/P&gt;&lt;P&gt;LOAD *,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; round(Alt(AccumFileSize,[File Size])/DateCount) as Rolling30AvgSize&lt;/P&gt;&lt;P&gt;Resident New&lt;/P&gt;&lt;P&gt;where Date1=Date;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP Table New;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;see the attached file&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 11 Oct 2017 11:31:36 GMT</pubDate>
    <dc:creator>Kushal_Chawda</dc:creator>
    <dc:date>2017-10-11T11:31:36Z</dc:date>
    <item>
      <title>Rolling 30-days Average</title>
      <link>https://community.qlik.com/t5/QlikView/Rolling-30-days-Average/m-p/1434566#M810041</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to calculate Rolling 30-days average using script &lt;STRONG&gt;(not by using expressions in the front end).&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Because I need to create a flag by comparing the normal average and Rolling 30-days average.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(If Normal avg &amp;gt;= Rolling 30-days avg then 0 otherwise 1) - Flag&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, I need to achieve these requirements in script itself. Am I right? Please help me out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attached the sample data in excel and qvw below. I need to find rolling 30-days file size average.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Siva.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rolling-30-days-Average/m-p/1434566#M810041</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling 30-days Average</title>
      <link>https://community.qlik.com/t5/QlikView/Rolling-30-days-Average/m-p/1434567#M810044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if for a particular day&amp;nbsp; I just have 15 days, so you want the Avg of 15 Days?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Oct 2017 11:00:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rolling-30-days-Average/m-p/1434567#M810044</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2017-10-11T11:00:11Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling 30-days Average</title>
      <link>https://community.qlik.com/t5/QlikView/Rolling-30-days-Average/m-p/1434568#M810046</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the &lt;SPAN style="font-size: 10pt;"&gt;reply, Kushal.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt; Yes, for a particular day I need it for 30 days.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Oct 2017 11:13:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rolling-30-days-Average/m-p/1434568#M810046</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-11T11:13:14Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling 30-days Average</title>
      <link>https://community.qlik.com/t5/QlikView/Rolling-30-days-Average/m-p/1434569#M810047</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;LOAD Date,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [File Name],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [File Size]&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;[Sample2.xlsx]&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is Sheet1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;join (Data)&lt;/P&gt;&lt;P&gt;LOAD Date as Date1&lt;/P&gt;&lt;P&gt;Resident Data;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;New:&lt;/P&gt;&lt;P&gt;LOAD *,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(Flag=1 and Previous(Flag)=0,[File Size],if(Previous(Flag)=1 and Flag&amp;lt;&amp;gt;0,rangesum([File Size],Peek('AccumFileSize')))) as AccumFileSize;&lt;/P&gt;&lt;P&gt;LOAD *,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(Date1-Date&amp;lt;=30 and Date1-Date&amp;gt;=0,1,0) as Flag&lt;/P&gt;&lt;P&gt;Resident Data&lt;/P&gt;&lt;P&gt;Order by Date1,Date;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP Table Data;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Left Join(New)&lt;/P&gt;&lt;P&gt;LOAD Sum(Flag) as DateCount,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date1&lt;/P&gt;&lt;P&gt;Resident New&lt;/P&gt;&lt;P&gt;Group by Date1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Final:&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;/P&gt;&lt;P&gt;LOAD *,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; round(Alt(AccumFileSize,[File Size])/DateCount) as Rolling30AvgSize&lt;/P&gt;&lt;P&gt;Resident New&lt;/P&gt;&lt;P&gt;where Date1=Date;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP Table New;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;see the attached file&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Oct 2017 11:31:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rolling-30-days-Average/m-p/1434569#M810047</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2017-10-11T11:31:36Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling 30-days Average</title>
      <link>https://community.qlik.com/t5/QlikView/Rolling-30-days-Average/m-p/1434570#M810048</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Kushal. But if I have file size for the same file name on different file dates, how can we manage it?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Oct 2017 12:35:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rolling-30-days-Average/m-p/1434570#M810048</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-11T12:35:26Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling 30-days Average</title>
      <link>https://community.qlik.com/t5/QlikView/Rolling-30-days-Average/m-p/1434571#M810049</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So do you want file Name wise rolling 30 Days ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Oct 2017 12:45:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rolling-30-days-Average/m-p/1434571#M810049</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2017-10-11T12:45:12Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling 30-days Average</title>
      <link>https://community.qlik.com/t5/QlikView/Rolling-30-days-Average/m-p/1434572#M810050</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry Kushal, I forgot to mention that there is file type. A file name has two file types. So I need to include that too.&lt;/P&gt;&lt;P&gt;Each file name can have two file size based on the file type.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Oct 2017 12:53:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rolling-30-days-Average/m-p/1434572#M810050</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-11T12:53:59Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling 30-days Average</title>
      <link>https://community.qlik.com/t5/QlikView/Rolling-30-days-Average/m-p/1434573#M810051</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Then the sample data is not enough to build that logic. Please share more sample data where we have Same Filenames on different date&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Oct 2017 12:57:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rolling-30-days-Average/m-p/1434573#M810051</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2017-10-11T12:57:32Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling 30-days Average</title>
      <link>https://community.qlik.com/t5/QlikView/Rolling-30-days-Average/m-p/1434574#M810052</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, please find sample data for that logic.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Oct 2017 13:07:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rolling-30-days-Average/m-p/1434574#M810052</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-11T13:07:27Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling 30-days Average</title>
      <link>https://community.qlik.com/t5/QlikView/Rolling-30-days-Average/m-p/1434575#M810053</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;see the attached&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Oct 2017 13:32:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rolling-30-days-Average/m-p/1434575#M810053</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2017-10-11T13:32:52Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling 30-days Average</title>
      <link>https://community.qlik.com/t5/QlikView/Rolling-30-days-Average/m-p/1434576#M810054</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your help Kushal. But I still didn't get the expected result. Is this possible only for a selected date?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Oct 2017 14:19:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rolling-30-days-Average/m-p/1434576#M810054</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-11T14:19:55Z</dc:date>
    </item>
  </channel>
</rss>

