<?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: Aggregate of previous n values in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Aggregate-of-previous-n-values/m-p/101897#M16202</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rangesum(above(aggr(Sum(Rating),work_request_ID),0,5))/5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rangeavg(above(aggr(Sum(Rating),work_request_ID),0,5))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 02 Nov 2018 13:05:58 GMT</pubDate>
    <dc:creator>Frank_Hartmann</dc:creator>
    <dc:date>2018-11-02T13:05:58Z</dc:date>
    <item>
      <title>Aggregate of previous n values</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregate-of-previous-n-values/m-p/101896#M16201</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to get an average of the previous 5 values of my dimension. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, I have a Rating score associated with a date and to a work_request_ID field. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to get an average Rating of the 5 most recent Rating values.&lt;/P&gt;&lt;P&gt;Is there a way of doing this in an expression? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am currently using this expression, but it is taking all values, not just the previous 5 I need.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RangeSum(above(Sum(Rating),0,4))&lt;/P&gt;&lt;P&gt;/5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Nov 2018 11:56:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregate-of-previous-n-values/m-p/101896#M16201</guid>
      <dc:creator>Qlik_ULG</dc:creator>
      <dc:date>2018-11-02T11:56:00Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregate of previous n values</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregate-of-previous-n-values/m-p/101897#M16202</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rangesum(above(aggr(Sum(Rating),work_request_ID),0,5))/5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rangeavg(above(aggr(Sum(Rating),work_request_ID),0,5))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Nov 2018 13:05:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregate-of-previous-n-values/m-p/101897#M16202</guid>
      <dc:creator>Frank_Hartmann</dc:creator>
      <dc:date>2018-11-02T13:05:58Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregate of previous n values</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregate-of-previous-n-values/m-p/101898#M16203</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Shane,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your formula should work (it works for me) - see attached file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Notice: Formula should be simplified: RangeAvg(Above(Sum(Sales),0,5))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Anders&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Nov 2018 13:09:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregate-of-previous-n-values/m-p/101898#M16203</guid>
      <dc:creator>anders_thorngaa</dc:creator>
      <dc:date>2018-11-02T13:09:03Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregate of previous n values</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregate-of-previous-n-values/m-p/101899#M16204</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks for the reply Frank, but no this is not working for me unfortunately. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Rating is only associated with a specific date and unique work_request but I do not want to have the work_request included in the calculation as I need the average Rating of the 5 most recently created work_requests&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Nov 2018 13:13:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregate-of-previous-n-values/m-p/101899#M16204</guid>
      <dc:creator>Qlik_ULG</dc:creator>
      <dc:date>2018-11-02T13:13:41Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregate of previous n values</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregate-of-previous-n-values/m-p/101900#M16205</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply Anders, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it is not working for me. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The previous Ratings I have are; &lt;/P&gt;&lt;P&gt;4&lt;/P&gt;&lt;P&gt;4&lt;/P&gt;&lt;P&gt;4&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;3&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So when I sum the first 5 records, I get 17, divided by 5 is 3.4. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Qlikview is giving me 3.8.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a sorting issue maybe and it is not selecting the 5 records that I need? It should be the 5 most recent values. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Nov 2018 13:16:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregate-of-previous-n-values/m-p/101900#M16205</guid>
      <dc:creator>Qlik_ULG</dc:creator>
      <dc:date>2018-11-02T13:16:47Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregate of previous n values</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregate-of-previous-n-values/m-p/101901#M16206</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;can u share a sample?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Nov 2018 13:26:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregate-of-previous-n-values/m-p/101901#M16206</guid>
      <dc:creator>Frank_Hartmann</dc:creator>
      <dc:date>2018-11-02T13:26:30Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregate of previous n values</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregate-of-previous-n-values/m-p/101902#M16207</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;!Hi Frank,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;attached is a data sheet of the the data. Only the rows that are shaded I wish to have included in the average calculation.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Nov 2018 13:39:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregate-of-previous-n-values/m-p/101902#M16207</guid>
      <dc:creator>Qlik_ULG</dc:creator>
      <dc:date>2018-11-02T13:39:50Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregate of previous n values</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregate-of-previous-n-values/m-p/101903#M16208</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try this in a TextBox:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({$&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"=rank(num(Date)) &amp;lt;=5"&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;}&amp;gt;} &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Rating&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)/5 &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Nov 2018 14:20:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregate-of-previous-n-values/m-p/101903#M16208</guid>
      <dc:creator>Frank_Hartmann</dc:creator>
      <dc:date>2018-11-02T14:20:59Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregate of previous n values</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregate-of-previous-n-values/m-p/101904#M16209</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;that is exactly it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a million Frank! (an old Irish saying!) &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Nov 2018 14:24:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregate-of-previous-n-values/m-p/101904#M16209</guid>
      <dc:creator>Qlik_ULG</dc:creator>
      <dc:date>2018-11-02T14:24:02Z</dc:date>
    </item>
  </channel>
</rss>

