<?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 given accumulated data matrix table, ?make previous 5-day average? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/given-accumulated-data-matrix-table-make-previous-5-day-average/m-p/199088#M58155</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 have a load statement that works and finds the accumulated values of an attribute over days.&lt;/P&gt;&lt;P&gt;X1:&lt;/P&gt;&lt;P&gt;load attribute, a_date, count(customer_id) as Accum&lt;/P&gt;&lt;P&gt;resident Input_Table&lt;/P&gt;&lt;P&gt;group by attribute, a_date;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But what I need now is a load statement to make a new table that calculates, for every a_date and attribute, the average of the Accums for the previous 5 days. ?Can you help me please?&lt;/P&gt;&lt;P&gt;Now, I can do this in a pivot-table using the RangeAvg function just fine, but you can't access the results of that nice pivot table by anything in QV at all, so I need a resident table that I can refer to later on.&lt;/P&gt;&lt;P&gt;Thx, Bob&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 01 Jan 2010 03:26:55 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-01-01T03:26:55Z</dc:date>
    <item>
      <title>given accumulated data matrix table, ?make previous 5-day average?</title>
      <link>https://community.qlik.com/t5/QlikView/given-accumulated-data-matrix-table-make-previous-5-day-average/m-p/199088#M58155</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 have a load statement that works and finds the accumulated values of an attribute over days.&lt;/P&gt;&lt;P&gt;X1:&lt;/P&gt;&lt;P&gt;load attribute, a_date, count(customer_id) as Accum&lt;/P&gt;&lt;P&gt;resident Input_Table&lt;/P&gt;&lt;P&gt;group by attribute, a_date;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But what I need now is a load statement to make a new table that calculates, for every a_date and attribute, the average of the Accums for the previous 5 days. ?Can you help me please?&lt;/P&gt;&lt;P&gt;Now, I can do this in a pivot-table using the RangeAvg function just fine, but you can't access the results of that nice pivot table by anything in QV at all, so I need a resident table that I can refer to later on.&lt;/P&gt;&lt;P&gt;Thx, Bob&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Jan 2010 03:26:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/given-accumulated-data-matrix-table-make-previous-5-day-average/m-p/199088#M58155</guid>
      <dc:creator />
      <dc:date>2010-01-01T03:26:55Z</dc:date>
    </item>
    <item>
      <title>given accumulated data matrix table, ?make previous 5-day average?</title>
      <link>https://community.qlik.com/t5/QlikView/given-accumulated-data-matrix-table-make-previous-5-day-average/m-p/199089#M58156</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The PEEK-function may be of some use for this task. Script should look like the below (not tested)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;LOAD&lt;BR /&gt;attribute,&lt;BR /&gt;a_date,&lt;BR /&gt;Accum,&lt;BR /&gt;(Accum + IF(attribute = PEEK(attribute, -1), PEEK(Accum, -1) + IF(attribute = PEEK(attribute, -2), PEEK(Accum, -2) ....) / (1 + IF(attribute = PEEK(attribute, -1), 1) + IF(attribute = PEEK(attribute, -2), 1) ....) AS Accum_sliding&lt;BR /&gt;RESIDENT&lt;BR /&gt;X1&lt;BR /&gt;ORDER BY&lt;BR /&gt;attribute,&lt;BR /&gt;a_date;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;There might be some more elegant solutions, but think that this plain approach should do.&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 Jan 2010 03:22:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/given-accumulated-data-matrix-table-make-previous-5-day-average/m-p/199089#M58156</guid>
      <dc:creator>prieper</dc:creator>
      <dc:date>2010-01-02T03:22:53Z</dc:date>
    </item>
  </channel>
</rss>

