<?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 Sum on Dimension by Specific Timeframe in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Rolling-Sum-on-Dimension-by-Specific-Timeframe/m-p/1560318#M598081</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to calculate a rolling sum, by a dimension called YYYYWK.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The YYYYWK is a format that follows 201801 - 201852, or 201901 - 201952, for example. It is every week for a year.&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I am trying to to do is, at a product level, calculate its sum for the past 13 weeks. Now I know I could do a rolling 13wk sum, but the issue is I do not want it to go back and calculate the previous 13 entries, rather the previous 13 weeks, even if some of the weeks do not have a weekly sum associated to it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, please see excel screenshot below. In the last entry, where YYYYWK = 201902, the rolled sum should be equal to 7938. It should be taking the sums from weeks that are equal to, or 13 weeks less than 201902. (201902+201901+201852+201851+201850+201849+201848+201847+201846+201845+201844+201843+201842).&amp;nbsp;&lt;/P&gt;&lt;P&gt;Again, what it should&amp;nbsp;&lt;STRONG&gt;not&lt;/STRONG&gt; be doing, is taking the sum of 201902, and the 12 entries that come before it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the formula that I did try (where $(cWeek-13Weeks) is a variable pointing to the week 13weeks from week selected:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;=sum({&amp;lt;YYYYWK = {"&amp;gt;=$(cWeek-13Weeks)"}&amp;gt;} Sum)&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;That does not, however, work. I have also tried putting this formula in with the range sum function, and even using the aggr function to see if that would help, but of course it did not.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help on how to write something that can take a rolling sum by specific dates would be very helpful.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 21:11:20 GMT</pubDate>
    <dc:creator>data_guru_001</dc:creator>
    <dc:date>2024-11-16T21:11:20Z</dc:date>
    <item>
      <title>Rolling Sum on Dimension by Specific Timeframe</title>
      <link>https://community.qlik.com/t5/QlikView/Rolling-Sum-on-Dimension-by-Specific-Timeframe/m-p/1560318#M598081</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to calculate a rolling sum, by a dimension called YYYYWK.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The YYYYWK is a format that follows 201801 - 201852, or 201901 - 201952, for example. It is every week for a year.&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I am trying to to do is, at a product level, calculate its sum for the past 13 weeks. Now I know I could do a rolling 13wk sum, but the issue is I do not want it to go back and calculate the previous 13 entries, rather the previous 13 weeks, even if some of the weeks do not have a weekly sum associated to it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, please see excel screenshot below. In the last entry, where YYYYWK = 201902, the rolled sum should be equal to 7938. It should be taking the sums from weeks that are equal to, or 13 weeks less than 201902. (201902+201901+201852+201851+201850+201849+201848+201847+201846+201845+201844+201843+201842).&amp;nbsp;&lt;/P&gt;&lt;P&gt;Again, what it should&amp;nbsp;&lt;STRONG&gt;not&lt;/STRONG&gt; be doing, is taking the sum of 201902, and the 12 entries that come before it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the formula that I did try (where $(cWeek-13Weeks) is a variable pointing to the week 13weeks from week selected:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;=sum({&amp;lt;YYYYWK = {"&amp;gt;=$(cWeek-13Weeks)"}&amp;gt;} Sum)&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;That does not, however, work. I have also tried putting this formula in with the range sum function, and even using the aggr function to see if that would help, but of course it did not.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help on how to write something that can take a rolling sum by specific dates would be very helpful.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 21:11:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rolling-Sum-on-Dimension-by-Specific-Timeframe/m-p/1560318#M598081</guid>
      <dc:creator>data_guru_001</dc:creator>
      <dc:date>2024-11-16T21:11:20Z</dc:date>
    </item>
  </channel>
</rss>

