<?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 Monthly Rolling in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Monthly-Rolling/m-p/208098#M63602</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah, good. There WAS a better solution than mine. Yeah, a data solution like this is probably the best way. I've added that approach to my example. The expression is complicated by the need to get a monthly average for the three months, but it is still MUCH simpler than what I had (and will execute more quickly, and selections will behave properly, and so on).&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;avg(aggr(sum({&amp;lt;RollingThreeMonthsFlag={1}&amp;gt;} Revenue),AsOfMonthYear,MonthYear))&lt;/P&gt;&lt;P&gt;If your ONLY flag ends up being for the rolling three months, you don't need a flag or set analysis at all. Just drop all the rows that don't match the rolling three months. I've added that approach too. The expression ends up like this, which I think is as simple as it's going to get while still doing a monthly average.&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;avg(aggr(sum(Revenue),RollingThreeMonthsAsOfMonthYear,MonthYear))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 09 Apr 2010 17:08:02 GMT</pubDate>
    <dc:creator>johnw</dc:creator>
    <dc:date>2010-04-09T17:08:02Z</dc:date>
    <item>
      <title>Monthly Rolling</title>
      <link>https://community.qlik.com/t5/QlikView/Monthly-Rolling/m-p/208094#M63598</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Guys,&lt;/P&gt;&lt;P&gt;I am trying to calc revenue year over year. The trick is they want it rolling every 3 months.&lt;/P&gt;&lt;P&gt;I was able to do the calc and use accumulation with 3 steps back. The problem is the first few months need to use the a few last months of last year. Right now for example Feb is averaging Jan and Feb but I need it to calc Dec from the previous year as well.&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Apr 2010 21:46:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Monthly-Rolling/m-p/208094#M63598</guid>
      <dc:creator />
      <dc:date>2010-04-08T21:46:29Z</dc:date>
    </item>
    <item>
      <title>Monthly Rolling</title>
      <link>https://community.qlik.com/t5/QlikView/Monthly-Rolling/m-p/208095#M63599</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you using &lt;STRONG&gt;AddMonths&lt;/STRONG&gt; to calculate the months to include? If I understood your problem, you aren't using date arithmetic. If there is another problem, please add a sample code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Apr 2010 22:42:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Monthly-Rolling/m-p/208095#M63599</guid>
      <dc:creator />
      <dc:date>2010-04-08T22:42:16Z</dc:date>
    </item>
    <item>
      <title>Monthly Rolling</title>
      <link>https://community.qlik.com/t5/QlikView/Monthly-Rolling/m-p/208096#M63600</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well. That turned out to be &lt;EM&gt;much&lt;/EM&gt; more difficult than I expected.&lt;/P&gt;&lt;P&gt;In the attached solution, I use a date island in combination with this rather complicated expression:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;avg(aggr(if(sum(if(MonthYear&amp;lt;=ChartMonthYear and MonthYear&amp;gt;=addmonths(ChartMonthYear,-2),Revenue))&lt;BR /&gt; ,sum(if(MonthYear&amp;lt;=ChartMonthYear and MonthYear&amp;gt;=addmonths(ChartMonthYear,-2),Revenue))),ChartMonthYear,MonthYear))&lt;/P&gt;&lt;P&gt;It does what I think you want, but it will have the usual drawbacks of date islands, mostly performance. And I'm convinced there's a better solution than mine. Still, &lt;EM&gt;some&lt;/EM&gt; solution is better than &lt;EM&gt;no&lt;/EM&gt; solution, so here you go.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Apr 2010 23:03:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Monthly-Rolling/m-p/208096#M63600</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2010-04-08T23:03:20Z</dc:date>
    </item>
    <item>
      <title>Monthly Rolling</title>
      <link>https://community.qlik.com/t5/QlikView/Monthly-Rolling/m-p/208097#M63601</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Kristen,&lt;/P&gt;&lt;P&gt;the best way of addressing rolling month averages is creating two sets of dates and linking them in a separate table, specifying for each date its relationship to the other date. I'm sure it's very confusing, so I'll try to explain:&lt;/P&gt;&lt;P&gt;1. Date # 1 is your Transaction Date.&lt;/P&gt;&lt;P&gt;2. Date # 2 is your "Display Date" (or, sometimes we call it "As of" date.&lt;/P&gt;&lt;P&gt;Create a table with all possible combinations of the two dates. You can do it by joining the two fields with no common keys - QlikView will conveniently create a Cartesian table of the two.&lt;/P&gt;&lt;P&gt;Now, calculate flags like "3_Rolling_Months_Flag", "3_Rolling_Month_Prior_Year_Flag", etc, using IF conditions and checking how one date relates to another. For example:&lt;/P&gt;&lt;P&gt;if( AddMonths(Transaction Date , 3) &amp;lt;= DisplayDate, 1, null()) as 3_Rolling_Months_Flag&lt;/P&gt;&lt;P&gt;(Using IF statements in the load script is not as bad as using them in the chart expressions)&lt;/P&gt;&lt;P&gt;Now, with the flags in your hands, you can use them in a couple of ways - either multiplying your amounts by the flag, or checking the flag in Set Analysis. The later is faster, if you are comfortable with the syntax. Examples:&lt;/P&gt;&lt;P&gt;sum(Revenue*[3_Months_Flag]) - will only summarize those transactions associated with the Transaction Dates that have Flag=1&lt;/P&gt;&lt;P&gt;The same result (a bit faster) can be achieved with the following:&lt;/P&gt;&lt;P&gt;sum( {&amp;lt; [3_Months_Flag] = {1}&amp;gt;} Revenue)&lt;/P&gt;&lt;P&gt;Your Dimension (and Selection field in List Boxes) should be the "Display Date", not the Transaction Date.&lt;/P&gt;&lt;P&gt;cheers,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Apr 2010 04:24:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Monthly-Rolling/m-p/208097#M63601</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2010-04-09T04:24:40Z</dc:date>
    </item>
    <item>
      <title>Monthly Rolling</title>
      <link>https://community.qlik.com/t5/QlikView/Monthly-Rolling/m-p/208098#M63602</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah, good. There WAS a better solution than mine. Yeah, a data solution like this is probably the best way. I've added that approach to my example. The expression is complicated by the need to get a monthly average for the three months, but it is still MUCH simpler than what I had (and will execute more quickly, and selections will behave properly, and so on).&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;avg(aggr(sum({&amp;lt;RollingThreeMonthsFlag={1}&amp;gt;} Revenue),AsOfMonthYear,MonthYear))&lt;/P&gt;&lt;P&gt;If your ONLY flag ends up being for the rolling three months, you don't need a flag or set analysis at all. Just drop all the rows that don't match the rolling three months. I've added that approach too. The expression ends up like this, which I think is as simple as it's going to get while still doing a monthly average.&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;avg(aggr(sum(Revenue),RollingThreeMonthsAsOfMonthYear,MonthYear))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Apr 2010 17:08:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Monthly-Rolling/m-p/208098#M63602</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2010-04-09T17:08:02Z</dc:date>
    </item>
    <item>
      <title>Monthly Rolling</title>
      <link>https://community.qlik.com/t5/QlikView/Monthly-Rolling/m-p/208099#M63603</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for all your help on this one. We were able to get it working.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Apr 2010 17:41:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Monthly-Rolling/m-p/208099#M63603</guid>
      <dc:creator />
      <dc:date>2010-04-13T17:41:20Z</dc:date>
    </item>
    <item>
      <title>Monthly Rolling</title>
      <link>https://community.qlik.com/t5/QlikView/Monthly-Rolling/m-p/208100#M63604</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Great solution!&lt;/P&gt;&lt;P&gt;Thanks for sharing!&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Fredrik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Sep 2010 14:25:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Monthly-Rolling/m-p/208100#M63604</guid>
      <dc:creator />
      <dc:date>2010-09-17T14:25:17Z</dc:date>
    </item>
  </channel>
</rss>

