<?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 Rolling 12 Month Total in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Rolling-12-Month-Total/m-p/201886#M59790</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the load script use&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;date(monthstart(Date),'MMM-YYYY') as Date_MonthYear,&lt;BR /&gt;etc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create two Variables:&lt;BR /&gt;vDate1, vDate2&lt;/P&gt;&lt;P&gt;Set vDate1 =date(addmonths(Date_MonthYear,-11),'MMM-YYYY')&lt;/P&gt;&lt;P&gt;and vDate2 =Date_MonthYear&lt;/P&gt;&lt;P&gt;Use the set analysis formula&lt;/P&gt;&lt;P&gt;=sum({$&amp;lt;Date_MonthYear={"&amp;gt;=$(#vDate1)&amp;lt;=$(#vDate2)"}&amp;gt;} despatched_qty*cost_of_sale)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;This will calculate for the twelve months rolling&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 25 Jun 2010 15:58:40 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-06-25T15:58:40Z</dc:date>
    <item>
      <title>Rolling 12 Month Total</title>
      <link>https://community.qlik.com/t5/QlikView/Rolling-12-Month-Total/m-p/201882#M59786</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;I'm trying to calculate a rolling 12 month total based on my dimensions Year and Month. I think the logic is as follows:&lt;/P&gt;&lt;P&gt;IF selected month = Dec, return YTD calculation (I already have the YTD formula to use), else selected year -1 and selected month +1.&lt;/P&gt;&lt;P&gt;For example, if I select Year = 2010; Month = May, the result will be the sum of sales &amp;gt;=2009 June and &amp;lt;=2010 May i.e. 12 months.&lt;/P&gt;&lt;P&gt;Can someone please help with the correct set analysis code to use? Alternatively if someone has a "cleverer" solution, please help with that.&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;APS&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Jun 2010 09:28:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rolling-12-Month-Total/m-p/201882#M59786</guid>
      <dc:creator />
      <dc:date>2010-06-25T09:28:42Z</dc:date>
    </item>
    <item>
      <title>Rolling 12 Month Total</title>
      <link>https://community.qlik.com/t5/QlikView/Rolling-12-Month-Total/m-p/201883#M59787</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;you could create a Variable&lt;/P&gt;&lt;P&gt;vDataStart=AddMonths&lt;B&gt;(vDataEnd&lt;/B&gt;&lt;B&gt;(),&lt;/B&gt; &lt;B&gt;-&lt;/B&gt;12&lt;B&gt;)&lt;/B&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SUM({$&amp;lt;DateOrder = {'&amp;gt;=$(vDataStart)&amp;lt;=$(vDataEnd)'}&amp;gt;} Price)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Jun 2010 10:00:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rolling-12-Month-Total/m-p/201883#M59787</guid>
      <dc:creator />
      <dc:date>2010-06-25T10:00:13Z</dc:date>
    </item>
    <item>
      <title>Rolling 12 Month Total</title>
      <link>https://community.qlik.com/t5/QlikView/Rolling-12-Month-Total/m-p/201884#M59788</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SUM({$&amp;lt;inv_head.Customer_create_date = {"&amp;gt;=$(=min(addmonths(monthstart(inv_head.create_date),-12))) &amp;lt;$(=min(addmonths(monthstart(inv_head.create_date),-12))) "}&amp;gt;} inv_Line.net_dom_amount * [MA Currency Rate])&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Jun 2010 12:51:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rolling-12-Month-Total/m-p/201884#M59788</guid>
      <dc:creator />
      <dc:date>2010-06-25T12:51:54Z</dc:date>
    </item>
    <item>
      <title>Rolling 12 Month Total</title>
      <link>https://community.qlik.com/t5/QlikView/Rolling-12-Month-Total/m-p/201885#M59789</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the responses. I've substituted in my field to give:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SUM({$&amp;lt;Cal.Month = {"&amp;gt;=$(=MIN(ADDMONTHS(MONTHSTART(Cal.Month),-12))) &amp;lt;$(=MIN(ADDMONTHS(MONTHSTART(Cal.Month),-12))) "}&amp;gt;} CEUs)&lt;/P&gt;&lt;P&gt;Unfortunately the result returns zero. As I have two dimensions: Cal.Month &amp;amp; Cal.Year, surely I need to have Cal.Year somewhere in the expression?&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Jun 2010 13:50:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rolling-12-Month-Total/m-p/201885#M59789</guid>
      <dc:creator />
      <dc:date>2010-06-25T13:50:22Z</dc:date>
    </item>
    <item>
      <title>Rolling 12 Month Total</title>
      <link>https://community.qlik.com/t5/QlikView/Rolling-12-Month-Total/m-p/201886#M59790</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the load script use&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;date(monthstart(Date),'MMM-YYYY') as Date_MonthYear,&lt;BR /&gt;etc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create two Variables:&lt;BR /&gt;vDate1, vDate2&lt;/P&gt;&lt;P&gt;Set vDate1 =date(addmonths(Date_MonthYear,-11),'MMM-YYYY')&lt;/P&gt;&lt;P&gt;and vDate2 =Date_MonthYear&lt;/P&gt;&lt;P&gt;Use the set analysis formula&lt;/P&gt;&lt;P&gt;=sum({$&amp;lt;Date_MonthYear={"&amp;gt;=$(#vDate1)&amp;lt;=$(#vDate2)"}&amp;gt;} despatched_qty*cost_of_sale)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;This will calculate for the twelve months rolling&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Jun 2010 15:58:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rolling-12-Month-Total/m-p/201886#M59790</guid>
      <dc:creator />
      <dc:date>2010-06-25T15:58:40Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling 12 Month Total</title>
      <link>https://community.qlik.com/t5/QlikView/Rolling-12-Month-Total/m-p/201887#M59791</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;I didn't understand the "date(monthstart(Date),'MMM-YYYY') as Date_MonthYear", because if I put below the LOAD, the assumption is this will be find in the excel file, no?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Aug 2014 19:46:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rolling-12-Month-Total/m-p/201887#M59791</guid>
      <dc:creator />
      <dc:date>2014-08-07T19:46:32Z</dc:date>
    </item>
  </channel>
</rss>

