<?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 Accumulated value of the last 12 months and of the previous period in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Accumulated-value-of-the-last-12-months-and-of-the-previous/m-p/1055271#M353828</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm willing to calculate the value accumulated of the last 12 months for the 13 months displayed in a chart, for example:&lt;/P&gt;&lt;P&gt;Apr-2015 -&amp;gt; Sums from Apr-2015 until May-2014&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Mar-2015 -&amp;gt; Sums from Mar-2015 until Apr-2014&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Apr-2014 -&amp;gt; Sums from Apr-2015 until May-2013&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Ok, that I got figured out with the following formula:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;if(Only({&amp;lt;&lt;/P&gt;&lt;P&gt;YearMonth ={"&amp;gt;=$(=Date(addmonths(Max(YearMonth), -12), 'MMM-YY'))&amp;lt;=$(=Date(addmonths(Max(YearMonth), -1),&amp;nbsp; 'MMM-YY'))"},&lt;/P&gt;&lt;P&gt;Year=,&lt;/P&gt;&lt;P&gt;Month=&amp;gt;} YearMonth),&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RangeSum&lt;/P&gt;&lt;P&gt;(&lt;/P&gt;&lt;P&gt;Above&lt;/P&gt;&lt;P&gt;(&lt;/P&gt;&lt;P&gt;Sum( {&amp;lt;&lt;/P&gt;&lt;P&gt;YearMonth ={"&amp;gt;=$(=Date(addmonths(Max(YearMonth), -23), 'MMM-YY'))&amp;lt;=$(=Date(addmonths(Max(YearMonth), -1),&amp;nbsp; 'MMM-YY'))"},&lt;/P&gt;&lt;P&gt;Year= ,&lt;/P&gt;&lt;P&gt;Month= &amp;gt;} &lt;/P&gt;&lt;P&gt;&amp;nbsp; Value)&lt;/P&gt;&lt;P&gt;,0,12)&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;,&lt;/P&gt;&lt;P&gt;RangeSum&lt;/P&gt;&lt;P&gt;(&lt;/P&gt;&lt;P&gt;Above&lt;/P&gt;&lt;P&gt;(&lt;/P&gt;&lt;P&gt;Sum({&amp;lt;&lt;/P&gt;&lt;P&gt;YearMonth ={"&amp;gt;=$(=Date(AddMonths(Max(YearMonth), -12), 'MMM-YY'))&amp;lt;=$(=Date(Max(YearMonth), 'MMM-YY'))"},&lt;/P&gt;&lt;P&gt;Year=,&lt;/P&gt;&lt;P&gt;Month=&amp;gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp; Value)&lt;/P&gt;&lt;P&gt;,0,12)&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;BR /&gt;The Only within the IF condition, is for the calculation of the months outside the period of 13 months.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;This works like a charm, but my problem now is to calculate the previous period, wich would be, in the same example:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Apr-2014 -&amp;gt; Sums from Apr-2014 until May-2013&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Mar-2014 -&amp;gt; Sums from Mar-2014 until Apr-2013&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Apr-2013 -&amp;gt; Sums from Apr-2013 until May-2012&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;I tryed using a AddYears(-1) in the YearMonth set analysis, but it didn't worked.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Any ideas?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 11 Mar 2016 12:10:27 GMT</pubDate>
    <dc:creator>kira_whopper</dc:creator>
    <dc:date>2016-03-11T12:10:27Z</dc:date>
    <item>
      <title>Accumulated value of the last 12 months and of the previous period</title>
      <link>https://community.qlik.com/t5/QlikView/Accumulated-value-of-the-last-12-months-and-of-the-previous/m-p/1055271#M353828</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm willing to calculate the value accumulated of the last 12 months for the 13 months displayed in a chart, for example:&lt;/P&gt;&lt;P&gt;Apr-2015 -&amp;gt; Sums from Apr-2015 until May-2014&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Mar-2015 -&amp;gt; Sums from Mar-2015 until Apr-2014&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Apr-2014 -&amp;gt; Sums from Apr-2015 until May-2013&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Ok, that I got figured out with the following formula:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;if(Only({&amp;lt;&lt;/P&gt;&lt;P&gt;YearMonth ={"&amp;gt;=$(=Date(addmonths(Max(YearMonth), -12), 'MMM-YY'))&amp;lt;=$(=Date(addmonths(Max(YearMonth), -1),&amp;nbsp; 'MMM-YY'))"},&lt;/P&gt;&lt;P&gt;Year=,&lt;/P&gt;&lt;P&gt;Month=&amp;gt;} YearMonth),&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RangeSum&lt;/P&gt;&lt;P&gt;(&lt;/P&gt;&lt;P&gt;Above&lt;/P&gt;&lt;P&gt;(&lt;/P&gt;&lt;P&gt;Sum( {&amp;lt;&lt;/P&gt;&lt;P&gt;YearMonth ={"&amp;gt;=$(=Date(addmonths(Max(YearMonth), -23), 'MMM-YY'))&amp;lt;=$(=Date(addmonths(Max(YearMonth), -1),&amp;nbsp; 'MMM-YY'))"},&lt;/P&gt;&lt;P&gt;Year= ,&lt;/P&gt;&lt;P&gt;Month= &amp;gt;} &lt;/P&gt;&lt;P&gt;&amp;nbsp; Value)&lt;/P&gt;&lt;P&gt;,0,12)&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;,&lt;/P&gt;&lt;P&gt;RangeSum&lt;/P&gt;&lt;P&gt;(&lt;/P&gt;&lt;P&gt;Above&lt;/P&gt;&lt;P&gt;(&lt;/P&gt;&lt;P&gt;Sum({&amp;lt;&lt;/P&gt;&lt;P&gt;YearMonth ={"&amp;gt;=$(=Date(AddMonths(Max(YearMonth), -12), 'MMM-YY'))&amp;lt;=$(=Date(Max(YearMonth), 'MMM-YY'))"},&lt;/P&gt;&lt;P&gt;Year=,&lt;/P&gt;&lt;P&gt;Month=&amp;gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp; Value)&lt;/P&gt;&lt;P&gt;,0,12)&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;BR /&gt;The Only within the IF condition, is for the calculation of the months outside the period of 13 months.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;This works like a charm, but my problem now is to calculate the previous period, wich would be, in the same example:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Apr-2014 -&amp;gt; Sums from Apr-2014 until May-2013&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Mar-2014 -&amp;gt; Sums from Mar-2014 until Apr-2013&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Apr-2013 -&amp;gt; Sums from Apr-2013 until May-2012&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;I tryed using a AddYears(-1) in the YearMonth set analysis, but it didn't worked.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Any ideas?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Mar 2016 12:10:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Accumulated-value-of-the-last-12-months-and-of-the-previous/m-p/1055271#M353828</guid>
      <dc:creator>kira_whopper</dc:creator>
      <dc:date>2016-03-11T12:10:27Z</dc:date>
    </item>
    <item>
      <title>Re: Accumulated value of the last 12 months and of the previous period</title>
      <link>https://community.qlik.com/t5/QlikView/Accumulated-value-of-the-last-12-months-and-of-the-previous/m-p/1055272#M353829</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See this document: &lt;A href="https://community.qlik.com/docs/DOC-4252"&gt;Calculating rolling n-period totals, averages or other aggregations&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Mar 2016 13:41:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Accumulated-value-of-the-last-12-months-and-of-the-previous/m-p/1055272#M353829</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2016-03-11T13:41:14Z</dc:date>
    </item>
    <item>
      <title>Re: Accumulated value of the last 12 months and of the previous period</title>
      <link>https://community.qlik.com/t5/QlikView/Accumulated-value-of-the-last-12-months-and-of-the-previous/m-p/1055273#M353830</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A managed to do it without changing the script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I modified the Abobe (from 0,12 to 12,12) and the YearMonth shift (from -23 and -12 to -35 and -24).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the new formula:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(Only({&amp;lt;YearMonth ={"&amp;gt;=$(=Date(addmonths(Max(YearMonth), -12), 'MMM-YY'))&amp;lt;=$(=Date(addmonths(Max(YearMonth), -1),&amp;nbsp; 'MMM-YY'))"}, Year=, Month=&amp;gt;} YearMonth),&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RangeSum&lt;/P&gt;&lt;P&gt;(&lt;/P&gt;&lt;P&gt;Above&lt;/P&gt;&lt;P&gt;(&lt;/P&gt;&lt;P&gt;Sum( {&amp;lt;&lt;/P&gt;&lt;P&gt;YearMonth ={"&amp;gt;=$(=Date(addmonths(Max(YearMonth), &lt;STRONG&gt;-35&lt;/STRONG&gt;), 'MMM-YY'))&amp;lt;=$(=Date(addmonths(Max(YearMonth), -1),&amp;nbsp; 'MMM-YY'))"}, &lt;/P&gt;&lt;P&gt;Year= ,&lt;/P&gt;&lt;P&gt;Month= &amp;gt;} &lt;/P&gt;&lt;P&gt; Value)&lt;/P&gt;&lt;P&gt;,&lt;STRONG&gt;12,12&lt;/STRONG&gt;)&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;,&lt;/P&gt;&lt;P&gt;RangeSum&lt;/P&gt;&lt;P&gt;(&lt;/P&gt;&lt;P&gt;Above&lt;/P&gt;&lt;P&gt;(&lt;/P&gt;&lt;P&gt;Sum({&amp;lt;&lt;/P&gt;&lt;P&gt;YearMonth ={"&amp;gt;=$(=Date(AddMonths(Max(YearMonth), &lt;STRONG&gt;-24&lt;/STRONG&gt;), 'MMM-YY'))&amp;lt;=$(=Date(Max(YearMonth), 'MMM-YY'))"},&lt;/P&gt;&lt;P&gt;Year=,&lt;/P&gt;&lt;P&gt;Month=&amp;gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp; Value)&lt;/P&gt;&lt;P&gt;,&lt;STRONG&gt;12,12&lt;/STRONG&gt;)&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Mar 2016 13:46:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Accumulated-value-of-the-last-12-months-and-of-the-previous/m-p/1055273#M353830</guid>
      <dc:creator>kira_whopper</dc:creator>
      <dc:date>2016-03-11T13:46:50Z</dc:date>
    </item>
  </channel>
</rss>

