<?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: Six Week average as of the Ship Date in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Six-Week-average-as-of-the-Ship-Date/m-p/2044411#M85943</link>
    <description>&lt;P&gt;Aggr(Sum(&lt;SPAN&gt;Aggr(sum({&amp;lt;DateFlag_SixWeek={1},CommodityCode={'LTC'},Flag_Shipped={1}&amp;gt;} EquivalentQuantity),&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;CommodityCode) / 6&lt;/SPAN&gt;),ShipDate)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try This&lt;/P&gt;</description>
    <pubDate>Thu, 02 Mar 2023 11:32:52 GMT</pubDate>
    <dc:creator>neerajthakur</dc:creator>
    <dc:date>2023-03-02T11:32:52Z</dc:date>
    <item>
      <title>Six Week average as of the Ship Date</title>
      <link>https://community.qlik.com/t5/App-Development/Six-Week-average-as-of-the-Ship-Date/m-p/2044159#M85928</link>
      <description>&lt;P&gt;I have the following expression that gives me a cumulative total of LTC EquivalentQuantity shipped for the current week:&lt;/P&gt;
&lt;P&gt;Aggr({&amp;lt;DateFlag_CurrentWeek={1},CommodityCode={'LTC'},Flag_Shipped={1}&amp;gt;} RangeSum(Above(sum({&amp;lt;DateFlag_CurrentWeek={1},CommodityCode={'LTC'},Flag_Shipped={1}&amp;gt;} EquivalentQuantity),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;And the Prior Wk expression is:&lt;/P&gt;
&lt;P&gt;Aggr({&amp;lt;DateFlag_LastWeek={1},CommodityCode={'LTC'},Flag_Shipped={1}&amp;gt;} RangeSum(Above(sum({&amp;lt;DateFlag_LastWeek={1},CommodityCode={'LTC'},Flag_Shipped={1}&amp;gt;} EquivalentQuantity),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;And here is what I have so far for the 6 week average:&lt;/P&gt;
&lt;P&gt;Aggr(sum({&amp;lt;DateFlag_SixWeek={1},CommodityCode={'LTC'},Flag_Shipped={1}&amp;gt;} EquivalentQuantity),&lt;BR /&gt;CommodityCode) / 6&lt;/P&gt;
&lt;P&gt;And here is what it looks like in a table:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mikegrattan_1-1677711413186.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/101764i2CA40A8162D45D1B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mikegrattan_1-1677711413186.png" alt="mikegrattan_1-1677711413186.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In order for the 6 wk average to look right in a line chart, I would like the number to populate for every ShipDate shown.&amp;nbsp; Is there a way to do that?&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2023 23:01:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Six-Week-average-as-of-the-Ship-Date/m-p/2044159#M85928</guid>
      <dc:creator>mikegrattan</dc:creator>
      <dc:date>2023-03-01T23:01:53Z</dc:date>
    </item>
    <item>
      <title>Re: Six Week average as of the Ship Date</title>
      <link>https://community.qlik.com/t5/App-Development/Six-Week-average-as-of-the-Ship-Date/m-p/2044411#M85943</link>
      <description>&lt;P&gt;Aggr(Sum(&lt;SPAN&gt;Aggr(sum({&amp;lt;DateFlag_SixWeek={1},CommodityCode={'LTC'},Flag_Shipped={1}&amp;gt;} EquivalentQuantity),&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;CommodityCode) / 6&lt;/SPAN&gt;),ShipDate)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try This&lt;/P&gt;</description>
      <pubDate>Thu, 02 Mar 2023 11:32:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Six-Week-average-as-of-the-Ship-Date/m-p/2044411#M85943</guid>
      <dc:creator>neerajthakur</dc:creator>
      <dc:date>2023-03-02T11:32:52Z</dc:date>
    </item>
    <item>
      <title>Re: Six Week average as of the Ship Date</title>
      <link>https://community.qlik.com/t5/App-Development/Six-Week-average-as-of-the-Ship-Date/m-p/2044429#M85944</link>
      <description>&lt;P&gt;Such things could be quite tricky and complicated and have sometimes side-effects, for example displaying unwanted extra rows within the object ... Therefore it might be more expedient to transfer the essential parts into the script.&lt;/P&gt;
&lt;P&gt;So ways to reach to show values for dimension-values to which they not native belong to are extending the aggr() with NODISTINCT statement and/or the aggregation with a TOTAL statement and/or using {1} within the set analysis to enforce the considering of all values - independent to the dimensions and/or the selection state. Sometimes it also requires to apply one or more extra aggr() wrappings.&lt;/P&gt;
&lt;P&gt;Quite often it's not possible to avoid the above mentioned extra rows within this logic-layer. Helpful in such cases is then usually to apply another boolean check against it - for example something like this:&lt;/P&gt;
&lt;P&gt;aggr(Expression, Dim) * if(Condition, 1, 0)&lt;/P&gt;
&lt;P&gt;means mainly that at first a lot of rows are evaluated and afterwards only the wanted ones are picked. A side-effect would be a rather slow performance - at least compared against simple dimensions/expressions.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Mar 2023 11:58:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Six-Week-average-as-of-the-Ship-Date/m-p/2044429#M85944</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2023-03-02T11:58:47Z</dc:date>
    </item>
    <item>
      <title>Re: Six Week average as of the Ship Date</title>
      <link>https://community.qlik.com/t5/App-Development/Six-Week-average-as-of-the-Ship-Date/m-p/2046274#M86061</link>
      <description>&lt;P&gt;The NODISTINCT worked for this scenario. Thanks Marcus.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2023 15:16:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Six-Week-average-as-of-the-Ship-Date/m-p/2046274#M86061</guid>
      <dc:creator>mikegrattan</dc:creator>
      <dc:date>2023-03-07T15:16:30Z</dc:date>
    </item>
  </channel>
</rss>

