<?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 Cumulative Sum (Rangesum) by week starts over on first day of month in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Cumulative-Sum-Rangesum-by-week-starts-over-on-first-day-of/m-p/2033461#M85149</link>
    <description>&lt;P&gt;I have the following expression in a table:&lt;/P&gt;
&lt;P&gt;aggr(rangesum(above(sum({&amp;lt;DateFlag_CurrentWeek={1}&amp;gt;}ShippedQuantity),0,RowNo())),CommodityCode,ShipDate)&lt;/P&gt;
&lt;P&gt;It kind of works, but something is wrong.&amp;nbsp; I would like to have a cumulative sum of ShippedQuantity by day, which starts over every Sunday, even when there's a new month included in the week's data.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mikegrattan_0-1675355850139.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/99586i116AAEE8EDD1AED3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mikegrattan_0-1675355850139.png" alt="mikegrattan_0-1675355850139.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Edit:&amp;nbsp; added a different screen shot, that includes the ShippedQuantity measure for comparison.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 02 Feb 2023 16:38:22 GMT</pubDate>
    <dc:creator>mikegrattan</dc:creator>
    <dc:date>2023-02-02T16:38:22Z</dc:date>
    <item>
      <title>Cumulative Sum (Rangesum) by week starts over on first day of month</title>
      <link>https://community.qlik.com/t5/App-Development/Cumulative-Sum-Rangesum-by-week-starts-over-on-first-day-of/m-p/2033461#M85149</link>
      <description>&lt;P&gt;I have the following expression in a table:&lt;/P&gt;
&lt;P&gt;aggr(rangesum(above(sum({&amp;lt;DateFlag_CurrentWeek={1}&amp;gt;}ShippedQuantity),0,RowNo())),CommodityCode,ShipDate)&lt;/P&gt;
&lt;P&gt;It kind of works, but something is wrong.&amp;nbsp; I would like to have a cumulative sum of ShippedQuantity by day, which starts over every Sunday, even when there's a new month included in the week's data.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mikegrattan_0-1675355850139.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/99586i116AAEE8EDD1AED3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mikegrattan_0-1675355850139.png" alt="mikegrattan_0-1675355850139.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Edit:&amp;nbsp; added a different screen shot, that includes the ShippedQuantity measure for comparison.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2023 16:38:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Cumulative-Sum-Rangesum-by-week-starts-over-on-first-day-of/m-p/2033461#M85149</guid>
      <dc:creator>mikegrattan</dc:creator>
      <dc:date>2023-02-02T16:38:22Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Sum (Rangesum) by week starts over on first day of month</title>
      <link>https://community.qlik.com/t5/App-Development/Cumulative-Sum-Rangesum-by-week-starts-over-on-first-day-of/m-p/2033561#M85162</link>
      <description>&lt;P&gt;try this:&lt;BR /&gt;Aggr(RangeSum(Above( (　sum(WeekMeasure)　) , 0, RowNo())), (StartOfWeek, (Numeric, Ascending), (Text, Ascending)), (WeekDate, (Numeric, Ascending), (Text, Ascending)))&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;you need to have the week and the date in your table.&amp;nbsp; the actual sum is also shown and you can see when it resets.&amp;nbsp; the table needs to be sorted by week and date&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="edwin_0-1675373878936.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/99594iA0C3F09D18ACAFB0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="edwin_0-1675373878936.png" alt="edwin_0-1675373878936.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2023 21:39:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Cumulative-Sum-Rangesum-by-week-starts-over-on-first-day-of/m-p/2033561#M85162</guid>
      <dc:creator>edwin</dc:creator>
      <dc:date>2023-02-02T21:39:52Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Sum (Rangesum) by week starts over on first day of month</title>
      <link>https://community.qlik.com/t5/App-Development/Cumulative-Sum-Rangesum-by-week-starts-over-on-first-day-of/m-p/2033566#M85164</link>
      <description>&lt;P&gt;i think what you are missing is just the dimension, all your aggr dimensions should be added to your table.&amp;nbsp; here i have a 3rd dimension to aggr by:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="edwin_0-1675374425679.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/99595i896FBCF106559672/image-size/medium?v=v2&amp;amp;px=400" role="button" title="edwin_0-1675374425679.png" alt="edwin_0-1675374425679.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2023 21:47:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Cumulative-Sum-Rangesum-by-week-starts-over-on-first-day-of/m-p/2033566#M85164</guid>
      <dc:creator>edwin</dc:creator>
      <dc:date>2023-02-02T21:47:12Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Sum (Rangesum) by week starts over on first day of month</title>
      <link>https://community.qlik.com/t5/App-Development/Cumulative-Sum-Rangesum-by-week-starts-over-on-first-day-of/m-p/2033579#M85165</link>
      <description>&lt;P&gt;I got the following formula to&amp;nbsp;&lt;EM&gt;mostly&lt;/EM&gt; work.&amp;nbsp; It aggregates the Rangesum just fine, but it's ignoring the set expression for my DateFlag_LastWeek.&amp;nbsp; I tried adding the set parameter in other parts of the expression but still can't get it to work.&amp;nbsp; Any ideas?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Aggr(RangeSum(Above((sum({&amp;lt;DateFlag_LastWeek={1}&amp;gt;}ShippedQuantity)),0,RowNo())),&lt;BR /&gt;(CommodityCode,(Numeric,Ascending),(Text(Ascending)), &lt;BR /&gt;(weekstart(ShipDate)), (Numeric, Ascending), (Text, Ascending)), &lt;BR /&gt;(ShipDate, (Numeric, Ascending), (Text, Ascending)))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2023 23:06:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Cumulative-Sum-Rangesum-by-week-starts-over-on-first-day-of/m-p/2033579#M85165</guid>
      <dc:creator>mikegrattan</dc:creator>
      <dc:date>2023-02-02T23:06:10Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Sum (Rangesum) by week starts over on first day of month</title>
      <link>https://community.qlik.com/t5/App-Development/Cumulative-Sum-Rangesum-by-week-starts-over-on-first-day-of/m-p/2033903#M85194</link>
      <description>&lt;P&gt;have you tried adding your set analysis into the AGGR?&lt;/P&gt;
&lt;P&gt;you may have to share some sample data&lt;/P&gt;</description>
      <pubDate>Fri, 03 Feb 2023 13:33:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Cumulative-Sum-Rangesum-by-week-starts-over-on-first-day-of/m-p/2033903#M85194</guid>
      <dc:creator>edwin</dc:creator>
      <dc:date>2023-02-03T13:33:01Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Sum (Rangesum) by week starts over on first day of month</title>
      <link>https://community.qlik.com/t5/App-Development/Cumulative-Sum-Rangesum-by-week-starts-over-on-first-day-of/m-p/2033967#M85205</link>
      <description>&lt;P&gt;I am getting correct cumulative numbers, but only when I set a filter manually.&lt;/P&gt;
&lt;P&gt;The set analysis isn't restricting the data set as I would expect.&amp;nbsp; In the example below, I added BusinessArea, CommodityCode, and DateFlag_LastWeek to the set analysis and inserted it in both the aggr and the Sum functions:&lt;/P&gt;
&lt;P&gt;Aggr({&amp;lt;DateFlag_LastWeek={1},BusinessArea={'GRW'},CommodityCode={'LTC'}&amp;gt;} RangeSum(Above(sum({&amp;lt;DateFlag_LastWeek={1},BusinessArea={'GRW'},CommodityCode={'LTC'}&amp;gt;} ShippedQuantity),0,RowNo())),&lt;BR /&gt;(CommodityCode,(Numeric,Ascending),(Text(Ascending)),&lt;BR /&gt;(weekstart(ShipDate)), (Numeric, Ascending), (Text, Ascending)),&lt;BR /&gt;(ShipDate, (Numeric, Ascending), (Text, Ascending)))&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't get any numbers until I set the filters as Selections.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mikegrattan_1-1675438506083.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/99687i3273359D9471EBE7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mikegrattan_1-1675438506083.png" alt="mikegrattan_1-1675438506083.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Feb 2023 15:35:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Cumulative-Sum-Rangesum-by-week-starts-over-on-first-day-of/m-p/2033967#M85205</guid>
      <dc:creator>mikegrattan</dc:creator>
      <dc:date>2023-02-03T15:35:46Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Sum (Rangesum) by week starts over on first day of month</title>
      <link>https://community.qlik.com/t5/App-Development/Cumulative-Sum-Rangesum-by-week-starts-over-on-first-day-of/m-p/2034069#M85209</link>
      <description>&lt;P&gt;This does work; I found more information in another post:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Uncheck 'Include Zero Values' under Add-ons -&amp;gt; Data handling&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Now the following expression works:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Aggr({&amp;lt;DateFlag_LastWeek={1},BusinessArea={'GRW'},CommodityCode={'LTC'}&amp;gt;} RangeSum(Above(sum({&amp;lt;DateFlag_LastWeek={1},BusinessArea={'GRW'},CommodityCode={'LTC'}&amp;gt;} ShippedQuantity),0,RowNo())),&lt;BR /&gt;(CommodityCode,(Numeric,Ascending),(Text(Ascending)),&lt;BR /&gt;(weekstart(ShipDate)), (Numeric, Ascending), (Text, Ascending)),&lt;BR /&gt;(ShipDate, (Numeric, Ascending), (Text, Ascending)))&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Feb 2023 20:36:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Cumulative-Sum-Rangesum-by-week-starts-over-on-first-day-of/m-p/2034069#M85209</guid>
      <dc:creator>mikegrattan</dc:creator>
      <dc:date>2023-02-03T20:36:10Z</dc:date>
    </item>
  </channel>
</rss>

