<?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: Problem rangesum for multiple years in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Problem-rangesum-for-multiple-years/m-p/827469#M291313</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My guess is that your Month field is simply the month and not related to the year. So if you have data from several years you get the sum of all the years for, say january, since every year will have a month january. Consider creating a monthyear field and use that instead: date(monthstart(MyDateField),'MMM YY') as MonthYear&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 21 May 2015 15:41:00 GMT</pubDate>
    <dc:creator>Gysbert_Wassenaar</dc:creator>
    <dc:date>2015-05-21T15:41:00Z</dc:date>
    <item>
      <title>Problem rangesum for multiple years</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-rangesum-for-multiple-years/m-p/827468#M291312</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;&lt;/P&gt;&lt;P&gt;I have a problem when trying to create a chart that displays our stock-levels over multiple years.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a table that contains a line for every booking (pos / neg) over the past years.&lt;/P&gt;&lt;P&gt;The fields I use are Product, Date, QTY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So when I need to show the stock on 31/12/2014 in the graph, I will need to calculate every booking up until 31/12/2014. I want to show 12 months in a graph, displaying the correct stock at that time.&amp;nbsp; Also I need to be able to show the stock for a previous year.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I use the following function and it works, but only if have no bookings older then 12 months.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;sum( Aggr( rangesum( above ( Sum( {1} [QTY]),0,12)), Month))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="87189" alt="" class="jive-image image-1" height="132" src="https://community.qlik.com/legacyfs/online/87189_pastedImage_6.png" style="max-width: 1200px; max-height: 900px; height: 132px; width: 743.662px;" width="744" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I then tried the following function:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;RangeSum(above(sum(QTY),0, RowNo()))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The problem with this formula is that it does not calculate the data from previous years. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone please assist me with this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bert&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 May 2015 14:44:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-rangesum-for-multiple-years/m-p/827468#M291312</guid>
      <dc:creator>bert_geraerts</dc:creator>
      <dc:date>2015-05-21T14:44:23Z</dc:date>
    </item>
    <item>
      <title>Re: Problem rangesum for multiple years</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-rangesum-for-multiple-years/m-p/827469#M291313</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My guess is that your Month field is simply the month and not related to the year. So if you have data from several years you get the sum of all the years for, say january, since every year will have a month january. Consider creating a monthyear field and use that instead: date(monthstart(MyDateField),'MMM YY') as MonthYear&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 May 2015 15:41:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-rangesum-for-multiple-years/m-p/827469#M291313</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2015-05-21T15:41:00Z</dc:date>
    </item>
    <item>
      <title>Re: Problem rangesum for multiple years</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-rangesum-for-multiple-years/m-p/827470#M291314</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried this already and the data is correct when I use set analysis to include all data and show all data.&lt;/P&gt;&lt;P&gt;But when I make a selection and show only 12 months, I get wrong data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I need a way to show only 12 months, but it needs to calculate the data from start to end.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or is my only option that I need to add a new record to the table with the end-stock from last year in januari?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 May 2015 16:06:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-rangesum-for-multiple-years/m-p/827470#M291314</guid>
      <dc:creator>bert_geraerts</dc:creator>
      <dc:date>2015-05-21T16:06:11Z</dc:date>
    </item>
    <item>
      <title>Re: Problem rangesum for multiple years</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-rangesum-for-multiple-years/m-p/827471#M291315</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I prefer to use variables when working with date ranges, I feel it provides more flexibility&lt;/P&gt;&lt;P&gt;check this post for more details&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/docs/DOC-4247"&gt;QlikView App: Dates, Date Ranges and Set Analysis&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 May 2015 16:06:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-rangesum-for-multiple-years/m-p/827471#M291315</guid>
      <dc:creator>ramoncova06</dc:creator>
      <dc:date>2015-05-21T16:06:28Z</dc:date>
    </item>
  </channel>
</rss>

