<?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: Add the new rows with the value of rolling average value in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Add-the-new-rows-with-the-value-of-rolling-average-value/m-p/1462184#M610680</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, still not working. After reload, it complain "Invalid expression". &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/sad.png" /&gt; My testing results show that whenever I use sum or other aggr function into to the script, it start to complain&amp;nbsp; "Invalid expression".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 10 Jan 2018 14:54:58 GMT</pubDate>
    <dc:creator>yonghanfi</dc:creator>
    <dc:date>2018-01-10T14:54:58Z</dc:date>
    <item>
      <title>Add the new rows with the value of rolling average value</title>
      <link>https://community.qlik.com/t5/QlikView/Add-the-new-rows-with-the-value-of-rolling-average-value/m-p/1462180#M610676</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Let's say I have a Currency table which can be simplified like below: &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="239"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" width="111"&gt;date&lt;/TD&gt;&lt;TD class="xl67" style="border-left: none;" width="64"&gt;rate &lt;/TD&gt;&lt;TD class="xl67" style="border-left: none;" width="64"&gt;currency&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;" width="111"&gt;….&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;" width="64"&gt;……&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;" width="64"&gt;…..&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="20" style="border-top: none;" width="111"&gt;28.12.2017&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;" width="64"&gt;7,4455&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;" width="64"&gt;DKK&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="20" style="border-top: none;" width="111"&gt;29.12.2017&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;" width="64"&gt;7,4449&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;" width="64"&gt;DKK&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="20" style="border-top: none;" width="111"&gt;30.12.2017&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;" width="64"&gt;7,4449&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;" width="64"&gt;DKK&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="20" style="border-top: none;" width="111"&gt;31.12.2017&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;" width="64"&gt;7,4449&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;" width="64"&gt;DKK&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="20" style="border-top: none;" width="111"&gt;1.1.2018&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;" width="64"&gt;7,4449&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;" width="64"&gt;DKK&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="20" style="border-top: none;" width="111"&gt;2.1.2018&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;" width="64"&gt;7,4437&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;" width="64"&gt;DKK&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="20" style="border-top: none;" width="111"&gt;3.1.2018&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;" width="64"&gt;7,4442&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;" width="64"&gt;DKK&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="20" style="border-top: none;" width="111"&gt;4.1.2018&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;" width="64"&gt;7,4449&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;" width="64"&gt;DKK&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="20" style="border-top: none;" width="111"&gt;5.1.2018&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;" width="64"&gt;7,4459&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;" width="64"&gt;DKK&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="20" style="border-top: none;" width="111"&gt;6.1.2018&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;" width="64"&gt;7,4459&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;" width="64"&gt;DKK&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="20" style="border-top: none;" width="111"&gt;7.1.2018&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;" width="64"&gt;7,4459&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;" width="64"&gt;DKK&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="20" style="border-top: none;" width="111"&gt;8.1.2018&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;" width="64"&gt;7,4467&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;" width="64"&gt;DKK&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let's assume the date start from 01.01.2016, I need to extend the data to one year in the future e.g. until 8.1.2019, and set the rate be the rolling average of the history data in last 365 days. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what I did was as below, &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;table_temp:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;LOAD &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;date,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt; Currency,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt; rate ,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;FROM &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;sourceData.qvd&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;where &lt;/SPAN&gt;Currency_id = 'DKK' &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;join&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;LOAD&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;date(Today()-2 + iterNo())&amp;nbsp; as date,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;'DKK' as currency&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;AUTOGENERATE 1&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;While date(Today()-2 + iterNo()) &amp;lt;= AddYears(Today()-2,1);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;currency:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;NOCONCATENATE &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;load&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; currency,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(IsNull(rate), RangeAvg(rate), rate) as rate,&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; currency_key&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Resident table_temp&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;order by exchange_rate_date;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;drop Table table_temp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;but I don't get, why rangeAvg(rate) did not work, instead it only returned the rate value from previous row. &lt;/P&gt;&lt;P&gt;Could anyone give some help? How can I get rate value from the last year's rolling average? Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jan 2018 13:50:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Add-the-new-rows-with-the-value-of-rolling-average-value/m-p/1462180#M610676</guid>
      <dc:creator>yonghanfi</dc:creator>
      <dc:date>2018-01-10T13:50:56Z</dc:date>
    </item>
    <item>
      <title>Re: Add the new rows with the value of rolling average value</title>
      <link>https://community.qlik.com/t5/QlikView/Add-the-new-rows-with-the-value-of-rolling-average-value/m-p/1462181#M610677</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;RangeAvg() should covered 2 arguments. Can you try this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;&lt;STRONG&gt;If(IsNull(rate), RangeAvg(rate, 0), rate) as rate,&amp;nbsp; &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jan 2018 13:54:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Add-the-new-rows-with-the-value-of-rolling-average-value/m-p/1462181#M610677</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2018-01-10T13:54:04Z</dc:date>
    </item>
    <item>
      <title>Re: Add the new rows with the value of rolling average value</title>
      <link>https://community.qlik.com/t5/QlikView/Add-the-new-rows-with-the-value-of-rolling-average-value/m-p/1462182#M610678</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried &lt;STRONG style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;RangeAvg(rate, 0)&lt;/STRONG&gt;, did not work, instead it only assign 0 as rate value after date 9.1.2018. Could you also explain what is the second argument in rangeavg()?&lt;/P&gt;&lt;P&gt;Thanks! Yong&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jan 2018 14:21:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Add-the-new-rows-with-the-value-of-rolling-average-value/m-p/1462182#M610678</guid>
      <dc:creator>yonghanfi</dc:creator>
      <dc:date>2018-01-10T14:21:34Z</dc:date>
    </item>
    <item>
      <title>Re: Add the new rows with the value of rolling average value</title>
      <link>https://community.qlik.com/t5/QlikView/Add-the-new-rows-with-the-value-of-rolling-average-value/m-p/1462183#M610679</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;currency:&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;&amp;nbsp;&amp;nbsp; date,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; currency,&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(IsNull(rate), RangeAvg(Sum(rate),0), rate) as rate,&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; currency_key&lt;/P&gt;&lt;P&gt;Resident table_temp &lt;STRONG&gt;Group By date, currency, currency_key&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;order by exchange_rate_date;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or else please share QVD/QVW??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jan 2018 14:31:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Add-the-new-rows-with-the-value-of-rolling-average-value/m-p/1462183#M610679</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2018-01-10T14:31:54Z</dc:date>
    </item>
    <item>
      <title>Re: Add the new rows with the value of rolling average value</title>
      <link>https://community.qlik.com/t5/QlikView/Add-the-new-rows-with-the-value-of-rolling-average-value/m-p/1462184#M610680</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, still not working. After reload, it complain "Invalid expression". &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/sad.png" /&gt; My testing results show that whenever I use sum or other aggr function into to the script, it start to complain&amp;nbsp; "Invalid expression".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jan 2018 14:54:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Add-the-new-rows-with-the-value-of-rolling-average-value/m-p/1462184#M610680</guid>
      <dc:creator>yonghanfi</dc:creator>
      <dc:date>2018-01-10T14:54:58Z</dc:date>
    </item>
    <item>
      <title>Re: Add the new rows with the value of rolling average value</title>
      <link>https://community.qlik.com/t5/QlikView/Add-the-new-rows-with-the-value-of-rolling-average-value/m-p/1462185#M610681</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Fine, Can you provide sample application&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jan 2018 14:58:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Add-the-new-rows-with-the-value-of-rolling-average-value/m-p/1462185#M610681</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2018-01-10T14:58:41Z</dc:date>
    </item>
  </channel>
</rss>

