<?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: Last 12 Month Average in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Last-12-Month-Average/m-p/490321#M183141</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;Something like this:&lt;/P&gt;&lt;P&gt;=Avg(aggr(Sum([Amount]), Brand))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Sep 2013 20:46:28 GMT</pubDate>
    <dc:creator>whiteline</dc:creator>
    <dc:date>2013-09-05T20:46:28Z</dc:date>
    <item>
      <title>Last 12 Month Average</title>
      <link>https://community.qlik.com/t5/QlikView/Last-12-Month-Average/m-p/490319#M183139</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to build an inventory app and I need to be able to produce the average inventory by brand for the last 12 months in a chart.&amp;nbsp; When I build the formula I get the 12 month average, but at the item level, so my data looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Month 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Month 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Month 3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Average&lt;/P&gt;&lt;P&gt;Brand A -&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 100,000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 200,000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 150,000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1,500 (based on item level averages versus total brand averages)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What formula can I use to the average of the last 12 months inventory for the total brand, which in this case would be 150,000?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Sep 2013 19:59:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Last-12-Month-Average/m-p/490319#M183139</guid>
      <dc:creator />
      <dc:date>2013-09-05T19:59:47Z</dc:date>
    </item>
    <item>
      <title>Re: Last 12 Month Average</title>
      <link>https://community.qlik.com/t5/QlikView/Last-12-Month-Average/m-p/490320#M183140</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looks like you need to use advanced aggregation with AGGR:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Summarize inventory numbers by Brand and Month&lt;/P&gt;&lt;P&gt;2. Average out the monthly totals and present the information by Brand.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, assuming that Brand is a Chart Dimension (and Month is not), your formula could looks along those lines:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AVG( AGGR ( sum(Inventory), Brand, YearMonth)) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;, with an addition of the 12-month condition and any other conditions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you need to show a historical trend of 12-month averages, then you need to use a technique called "As of date". I just wrote a blog about it:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.naturalsynergies.com/q-tip-4-how-to-use-as-of-date-table/" title="http://www.naturalsynergies.com/q-tip-4-how-to-use-as-of-date-table/"&gt;QlikView Blog Q-Tip #4 How to Use "As of Date" table | Natural Synergies&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;best,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Oleg Troyansky &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Sep 2013 20:35:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Last-12-Month-Average/m-p/490320#M183140</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2013-09-05T20:35:50Z</dc:date>
    </item>
    <item>
      <title>Re: Last 12 Month Average</title>
      <link>https://community.qlik.com/t5/QlikView/Last-12-Month-Average/m-p/490321#M183141</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;Something like this:&lt;/P&gt;&lt;P&gt;=Avg(aggr(Sum([Amount]), Brand))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Sep 2013 20:46:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Last-12-Month-Average/m-p/490321#M183141</guid>
      <dc:creator>whiteline</dc:creator>
      <dc:date>2013-09-05T20:46:28Z</dc:date>
    </item>
  </channel>
</rss>

