<?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 Use aggr to calculate seven day average in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Use-aggr-to-calculate-seven-day-average/m-p/1280333#M26653</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to calculate a last seven-day average by selection of date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I used the following calculation but doesn't seem to give me the desired result.It only work if I make no selection (in this case will calculate last 7-day average from max(event_date). Or I have select all seven days in order for it to render the correct answer. Please help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;avg(aggr(sum({$&amp;lt;event_date={"&amp;gt;$(=date(max(event_date)-7,'YYYY-MM-DD'))&amp;lt;=$(=max(event_date))"}&amp;gt;}usercnt),event_date))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xinzhen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 20 Nov 2016 18:00:51 GMT</pubDate>
    <dc:creator />
    <dc:date>2016-11-20T18:00:51Z</dc:date>
    <item>
      <title>Use aggr to calculate seven day average</title>
      <link>https://community.qlik.com/t5/App-Development/Use-aggr-to-calculate-seven-day-average/m-p/1280333#M26653</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to calculate a last seven-day average by selection of date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I used the following calculation but doesn't seem to give me the desired result.It only work if I make no selection (in this case will calculate last 7-day average from max(event_date). Or I have select all seven days in order for it to render the correct answer. Please help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;avg(aggr(sum({$&amp;lt;event_date={"&amp;gt;$(=date(max(event_date)-7,'YYYY-MM-DD'))&amp;lt;=$(=max(event_date))"}&amp;gt;}usercnt),event_date))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xinzhen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 20 Nov 2016 18:00:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Use-aggr-to-calculate-seven-day-average/m-p/1280333#M26653</guid>
      <dc:creator />
      <dc:date>2016-11-20T18:00:51Z</dc:date>
    </item>
    <item>
      <title>Re: Use aggr to calculate seven day average</title>
      <link>https://community.qlik.com/t5/App-Development/Use-aggr-to-calculate-seven-day-average/m-p/1280334#M26654</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;may be this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;avg(aggr(sum({$&amp;lt;event_date={"&amp;gt;$(=date(max(event_date)-7,'YYYY-MM-DD'))&amp;lt;=$(=date(max(event_date),'YYYY-MM-DD')"}&amp;gt;}usercnt),event_date))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Nov 2016 12:31:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Use-aggr-to-calculate-seven-day-average/m-p/1280334#M26654</guid>
      <dc:creator>brunobertels</dc:creator>
      <dc:date>2016-11-21T12:31:08Z</dc:date>
    </item>
    <item>
      <title>Re: Use aggr to calculate seven day average</title>
      <link>https://community.qlik.com/t5/App-Development/Use-aggr-to-calculate-seven-day-average/m-p/1280335#M26655</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try giving the set analysis to your outer aggregation function also&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;Avg(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;SPAN style="color: #ff0000;"&gt;{$&amp;lt;event_date={"&amp;gt;$(=date(max(event_date)-7,'YYYY-MM-DD'))&amp;lt;=$(=max(event_date))"}&amp;gt;}&lt;/SPAN&gt; &lt;/SPAN&gt;Aggr(Sum({$&amp;lt;event_date={"&amp;gt;$(=date(max(event_date)-7,'YYYY-MM-DD'))&amp;lt;=$(=max(event_date))"}&amp;gt;} usercnt), event_date))&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Nov 2016 12:36:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Use-aggr-to-calculate-seven-day-average/m-p/1280335#M26655</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-11-21T12:36:25Z</dc:date>
    </item>
    <item>
      <title>Re: Use aggr to calculate seven day average</title>
      <link>https://community.qlik.com/t5/App-Development/Use-aggr-to-calculate-seven-day-average/m-p/1280336#M26656</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Sunny!!&lt;/P&gt;&lt;P&gt;This worked! What is the reason I need set analysis in both inside and outside of aggr?&lt;/P&gt;&lt;P&gt;Xinzhen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Nov 2016 23:33:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Use-aggr-to-calculate-seven-day-average/m-p/1280336#M26656</guid>
      <dc:creator />
      <dc:date>2016-11-21T23:33:24Z</dc:date>
    </item>
    <item>
      <title>Re: Use aggr to calculate seven day average</title>
      <link>https://community.qlik.com/t5/App-Development/Use-aggr-to-calculate-seven-day-average/m-p/1280337#M26657</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since your outer aggregation was not set to show any date range, it was drilling down to the current selection even though your inner aggregation was set. Its always advisable to set the limits used in inner set analysis in your outer aggregation function also unless you are deliberately looking to let it change based on current selection.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Nov 2016 01:42:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Use-aggr-to-calculate-seven-day-average/m-p/1280337#M26657</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-11-22T01:42:34Z</dc:date>
    </item>
  </channel>
</rss>

