<?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: Cumulative total of weekly average in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Cumulative-total-of-weekly-average/m-p/2052580#M86515</link>
    <description>&lt;P&gt;Hi Gabbar,&lt;/P&gt;
&lt;P&gt;That gives me some unexpected results.&amp;nbsp; I'm not getting every day of the week, or even the last day of the week.&amp;nbsp; I'm getting a combination of Tuesday, Thursday, and Friday, and the numbers are not cumulative.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mikegrattan_0-1679582913885.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/103385iD4D62E668A67357E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mikegrattan_0-1679582913885.png" alt="mikegrattan_0-1679582913885.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I played around with it some more and ended up with the following:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Removed ShipDate_DayOfWeek from the table&lt;/LI&gt;
&lt;LI&gt;Used the Modifier feature to accumulate across all dimensions, starting with the expression I originally posted&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;The modifier output the following expression:&lt;/P&gt;
&lt;P&gt;RangeSum(Above(Total (　RangeSum(Above( (　Aggr(Avg(TOTAL &amp;lt;Week&amp;gt; Aggr(Sum( EquivalentQuantity),&lt;BR /&gt;ShipDate_DayOfWeek, Week)),ShipDate_DayOfWeek, Week)　) , 0, 6))　) , 0, 6))&lt;/P&gt;
&lt;P&gt;And now the table looks correct:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mikegrattan_1-1679584175510.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/103389iA2EABC776800C6A1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mikegrattan_1-1679584175510.png" alt="mikegrattan_1-1679584175510.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I'm going to try adding a set expression and see if it maintains its integrity; right now I'm manually filtering on LTC for the CommodityCode and DateFlag_LastSixWeeks = 1 for the time frame.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your initial response; if adding the set expression messes up my current results I'll post again and perhaps you can help point me in the right direction.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 23 Mar 2023 15:15:07 GMT</pubDate>
    <dc:creator>mikegrattan</dc:creator>
    <dc:date>2023-03-23T15:15:07Z</dc:date>
    <item>
      <title>Cumulative total of weekly average</title>
      <link>https://community.qlik.com/t5/App-Development/Cumulative-total-of-weekly-average/m-p/2052232#M86501</link>
      <description>&lt;P&gt;I have a table with the following fields:&lt;/P&gt;
&lt;P&gt;CommodityCode&lt;BR /&gt;Week&lt;BR /&gt;ShipDate_DayOfWeek&lt;BR /&gt;EquivalentQuantity&lt;BR /&gt;Avg&lt;BR /&gt;&lt;BR /&gt;The expression for Weekly Avg is:&lt;BR /&gt;Aggr(Avg(TOTAL &amp;lt;Week&amp;gt; Aggr(Sum(EquivalentQuantity),ShipDate_DayOfWeek, Week)), ShipDate_DayOfWeek, Week)&lt;/P&gt;
&lt;P&gt;This gives me a weekly average, which is repeated for each day of the week.&amp;nbsp; My goal is to get a cumulative sum of the weekly average.&amp;nbsp; For example; in the screen shot below the average for Week 06 is 21,149 and the average for Week 07 is 23,673, so the cumulative total for Week 07 would be 44,822.&amp;nbsp; Please advise; thanks for any help.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mikegrattan_0-1679520016664.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/103314i67E00513528E4B96/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mikegrattan_0-1679520016664.png" alt="mikegrattan_0-1679520016664.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Mar 2023 21:23:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Cumulative-total-of-weekly-average/m-p/2052232#M86501</guid>
      <dc:creator>mikegrattan</dc:creator>
      <dc:date>2023-03-22T21:23:12Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative total of weekly average</title>
      <link>https://community.qlik.com/t5/App-Development/Cumulative-total-of-weekly-average/m-p/2052324#M86506</link>
      <description>&lt;P&gt;try this:-&lt;BR /&gt;&lt;SPAN&gt;Rangesum(Above(Aggr(Avg(TOTAL &amp;lt;Week&amp;gt; Aggr(Sum(EquivalentQuantity),ShipDate_DayOfWeek, Week)), (Week,(Numeric,Ascending))),0,rowno()))&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2023 06:55:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Cumulative-total-of-weekly-average/m-p/2052324#M86506</guid>
      <dc:creator>Gabbar</dc:creator>
      <dc:date>2023-03-23T06:55:17Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative total of weekly average</title>
      <link>https://community.qlik.com/t5/App-Development/Cumulative-total-of-weekly-average/m-p/2052580#M86515</link>
      <description>&lt;P&gt;Hi Gabbar,&lt;/P&gt;
&lt;P&gt;That gives me some unexpected results.&amp;nbsp; I'm not getting every day of the week, or even the last day of the week.&amp;nbsp; I'm getting a combination of Tuesday, Thursday, and Friday, and the numbers are not cumulative.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mikegrattan_0-1679582913885.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/103385iD4D62E668A67357E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mikegrattan_0-1679582913885.png" alt="mikegrattan_0-1679582913885.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I played around with it some more and ended up with the following:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Removed ShipDate_DayOfWeek from the table&lt;/LI&gt;
&lt;LI&gt;Used the Modifier feature to accumulate across all dimensions, starting with the expression I originally posted&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;The modifier output the following expression:&lt;/P&gt;
&lt;P&gt;RangeSum(Above(Total (　RangeSum(Above( (　Aggr(Avg(TOTAL &amp;lt;Week&amp;gt; Aggr(Sum( EquivalentQuantity),&lt;BR /&gt;ShipDate_DayOfWeek, Week)),ShipDate_DayOfWeek, Week)　) , 0, 6))　) , 0, 6))&lt;/P&gt;
&lt;P&gt;And now the table looks correct:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mikegrattan_1-1679584175510.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/103389iA2EABC776800C6A1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mikegrattan_1-1679584175510.png" alt="mikegrattan_1-1679584175510.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I'm going to try adding a set expression and see if it maintains its integrity; right now I'm manually filtering on LTC for the CommodityCode and DateFlag_LastSixWeeks = 1 for the time frame.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your initial response; if adding the set expression messes up my current results I'll post again and perhaps you can help point me in the right direction.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2023 15:15:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Cumulative-total-of-weekly-average/m-p/2052580#M86515</guid>
      <dc:creator>mikegrattan</dc:creator>
      <dc:date>2023-03-23T15:15:07Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative total of weekly average</title>
      <link>https://community.qlik.com/t5/App-Development/Cumulative-total-of-weekly-average/m-p/2052597#M86516</link>
      <description>&lt;P&gt;Although I got the cumulative sum of the weekly average to work correctly using manually selected filters, I am now at a point where I'd like to get it to work with a set expression.&amp;nbsp; The following does not work, so I probably need to modify it so the set expression is processed at multiple levels within the overall expression.&amp;nbsp; If this needs a new question posted, I can do that.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;RangeSum(Above(Total (　RangeSum(Above( (　Aggr(Avg(TOTAL &amp;lt;Week&amp;gt; Aggr(Sum({&amp;lt;DateFlag_SixWeek={1},CommodityCode={'LTC'}&amp;gt;} EquivalentQuantity),&lt;BR /&gt;ShipDate_DayOfWeek, Week)),ShipDate_DayOfWeek, Week)　) , 0, 6))　) , 0, 6))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2023 15:37:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Cumulative-total-of-weekly-average/m-p/2052597#M86516</guid>
      <dc:creator>mikegrattan</dc:creator>
      <dc:date>2023-03-23T15:37:19Z</dc:date>
    </item>
  </channel>
</rss>

