<?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: Rolling sum of sales over previous weeks in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Rolling-sum-of-sales-over-previous-weeks/m-p/282213#M496749</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Wim,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please go through the attached document, hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jagan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 06 Dec 2011 14:20:53 GMT</pubDate>
    <dc:creator>jagan</dc:creator>
    <dc:date>2011-12-06T14:20:53Z</dc:date>
    <item>
      <title>Rolling sum of sales over previous weeks</title>
      <link>https://community.qlik.com/t5/QlikView/Rolling-sum-of-sales-over-previous-weeks/m-p/282212#M496748</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For some days now the problem below is my top priority. However I seem to be unable to solve it. Maybe someone here can help:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please consider a database table with salesrecords. &lt;/P&gt;&lt;P&gt;Fields: Year, Week, Salesvalue&lt;/P&gt;&lt;P&gt;There is around 6 years of sales available.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm looking for a solution in which I can make a rolling 12 week total. For example:&lt;/P&gt;&lt;P&gt;2010 - 47 - 600&lt;/P&gt;&lt;P&gt;﻿﻿﻿2010 - 48 - 500&lt;/P&gt;&lt;P&gt;2010 - 49 - 550 &lt;/P&gt;&lt;P&gt;2010 - 50 - 400&lt;/P&gt;&lt;P&gt;2010 - 51 - 350&lt;/P&gt;&lt;P&gt;2010 - 52 - 400&lt;/P&gt;&lt;P&gt;2011 - 1 - 100&lt;/P&gt;&lt;P&gt;2011 - 2 - 150&lt;/P&gt;&lt;P&gt;2011 - 3 - 125&lt;/P&gt;&lt;P&gt;2011 - 4 - 130 &lt;/P&gt;&lt;P&gt;2011 - 5 - 75 &lt;/P&gt;&lt;P&gt;2011 - 6 - 700&lt;/P&gt;&lt;P&gt;2011 - 7 - 775&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Feelds needed: This week; Last week; Last 4 weeks; Last 12 weeks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Selecting Year 2011, Week 7 Should result in:&lt;/P&gt;&lt;TABLE border="1" cellpadding="3" cellspacing="0" class="jiveBorder" style="width: 75%; border: #000000 1px solid;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Year&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Week&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;This Week&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Last Week&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Last 4 weeks&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Last 12 weeks&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2011&lt;/TD&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;TD&gt;775&lt;/TD&gt;&lt;TD&gt;700&lt;/TD&gt;&lt;TD&gt;775+700+75+130&lt;/TD&gt;&lt;TD&gt;775+700+75+...+550+500&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;﻿﻿&lt;/P&gt;&lt;P&gt;﻿Selecting Year 2011, Week 6 Should result in:&lt;/P&gt;&lt;TABLE border="1" cellpadding="3" cellspacing="0" class="jiveBorder" style="width: 75%; border: 1px solid #000000;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Year&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Week&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;This Week&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Last Week&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Last 4 weeks&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Last 12 weeks&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2011&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;TD&gt;700&lt;/TD&gt;&lt;TD&gt;75&lt;/TD&gt;&lt;TD&gt;700+75+130+125&lt;/TD&gt;&lt;TD&gt;700+75+130+...+500+600&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fields this week and last week I resolved myself. For this I used set analysis. The 2 last fields `last 4 weeks` and `last 12 weeks` are causing me a headache especially when taking into account the change of years.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried working with a week counter; but this solution is not acceptable to management as they just want to select year and week.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone help?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wim&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;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Dec 2011 12:46:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rolling-sum-of-sales-over-previous-weeks/m-p/282212#M496748</guid>
      <dc:creator />
      <dc:date>2011-12-06T12:46:27Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling sum of sales over previous weeks</title>
      <link>https://community.qlik.com/t5/QlikView/Rolling-sum-of-sales-over-previous-weeks/m-p/282213#M496749</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Wim,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please go through the attached document, hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jagan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Dec 2011 14:20:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rolling-sum-of-sales-over-previous-weeks/m-p/282213#M496749</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2011-12-06T14:20:53Z</dc:date>
    </item>
    <item>
      <title>Rolling sum of sales over previous weeks</title>
      <link>https://community.qlik.com/t5/QlikView/Rolling-sum-of-sales-over-previous-weeks/m-p/282214#M496750</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Jagan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried your solution and in the provided scenario it works. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However when implemented with real data I do of course have dimensions such as Customer, Product, etc. In this implementation the total running 12 weeks for each customer is the same as the total for all customers. Adding to the variable `customer.name=` only helps when an actual customer is selected and thus no cross customer comparison is possible. Is there a work around for this so that it works flexible with dimensions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Dec 2011 15:10:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rolling-sum-of-sales-over-previous-weeks/m-p/282214#M496750</guid>
      <dc:creator />
      <dc:date>2011-12-06T15:10:43Z</dc:date>
    </item>
  </channel>
</rss>

