<?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: Avg of aggregated function in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Avg-of-aggregated-function/m-p/837311#M294461</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to make sure that &lt;SPAN style="color: #800000; font-size: 8pt;"&gt;SoD_SettlementOrder&lt;/SPAN&gt; is numeric and then you should have in mind that &lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"$(=max(SoD_SettlementOrder))"&lt;/SPAN&gt; will create a variable which could only have one value at a time and which will be calculated once for the whole chart and applied for each calculation on row-level.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 27 Apr 2015 14:57:09 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2015-04-27T14:57:09Z</dc:date>
    <item>
      <title>Avg of aggregated function</title>
      <link>https://community.qlik.com/t5/QlikView/Avg-of-aggregated-function/m-p/837306#M294456</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;I need to show the average of the below function.&lt;/P&gt;&lt;P&gt;For instance calculating the average for three days.&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//O&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;SPAN style="color: #0000ff;"&gt;Sum&lt;/SPAN&gt;({ ({&amp;lt;&lt;SPAN style="color: #800000;"&gt;SoD_Site&lt;/SPAN&gt;= {'XXX'}&amp;gt;} &lt;SPAN style="color: #0000ff;"&gt;Aggr&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;IF&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;SoD_SettlementOrder&lt;/SPAN&gt;= (&lt;SPAN style="color: #0000ff;"&gt;MAX&lt;/SPAN&gt;({ &amp;lt;&lt;SPAN style="color: #800000;"&gt;SoD_Site&lt;/SPAN&gt;= {'XXX'}&amp;gt;} &lt;SPAN style="color: #0000ff;"&gt;TOTAL&lt;/SPAN&gt; &amp;lt;&lt;SPAN style="color: #800000;"&gt;Date&lt;/SPAN&gt;&amp;gt; &lt;SPAN style="color: #800000;"&gt;SoD_SettlementOrder&lt;/SPAN&gt;)), &lt;SPAN style="color: #0000ff;"&gt;Sum&lt;/SPAN&gt;({ &amp;lt;&lt;SPAN style="color: #800000;"&gt;SoD_Site&lt;/SPAN&gt;= {'XXX'}&amp;gt;} &lt;SPAN style="color: #800000;"&gt;SoD_RunningBalance&lt;/SPAN&gt;)), &lt;SPAN style="color: #800000;"&gt;Date&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;SoD_SettlementOrder&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;)) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Apr 2015 09:55:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Avg-of-aggregated-function/m-p/837306#M294456</guid>
      <dc:creator />
      <dc:date>2015-04-15T09:55:06Z</dc:date>
    </item>
    <item>
      <title>Re: Avg of aggregated function</title>
      <link>https://community.qlik.com/t5/QlikView/Avg-of-aggregated-function/m-p/837307#M294457</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This looked very weird. I think the expression should more look like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;avg(aggr(sum({&amp;lt; Condition = {'xxx'}&amp;gt;} value), Dimension))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See also: &lt;A href="https://community.qlik.com/qlik-blogpost/3208"&gt;Average – Which average?&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Apr 2015 11:30:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Avg-of-aggregated-function/m-p/837307#M294457</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2015-04-15T11:30:54Z</dc:date>
    </item>
    <item>
      <title>Re: Avg of aggregated function</title>
      <link>https://community.qlik.com/t5/QlikView/Avg-of-aggregated-function/m-p/837308#M294458</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It does look a bit weird I agree, but It also gives me the expected values.&lt;/P&gt;&lt;P&gt;In your example above there is only one condition, but I have two.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;This is what it shows.&lt;/P&gt;&lt;P&gt;And now I need the AVG of the below function.&lt;/P&gt;&lt;P&gt;I tried but could not make it work &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/sad.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;-------AVG OF---------&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;For the chosen &lt;STRONG&gt;Date&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;For a perticular&lt;STRONG&gt; SoD_Site&lt;/STRONG&gt; ('XXX')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;Show the&lt;STRONG&gt; SoD_RunningBalance&lt;/STRONG&gt; corresponding to the&lt;/SPAN&gt;&lt;STRONG style="color: #ff0000;"&gt; MAX(SettlementOrder)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Apr 2015 12:21:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Avg-of-aggregated-function/m-p/837308#M294458</guid>
      <dc:creator />
      <dc:date>2015-04-15T12:21:29Z</dc:date>
    </item>
    <item>
      <title>Re: Avg of aggregated function</title>
      <link>https://community.qlik.com/t5/QlikView/Avg-of-aggregated-function/m-p/837309#M294459</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could put more conditions as one in your expression, maybe:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;avg(aggr(sum({&amp;lt; Condition1 = {'xxx'}, &lt;STRONG&gt;Condition2 = {"$(=max(SettlementOrder))"}&lt;/STRONG&gt;&amp;gt;} value), Dimension))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Often it's easier to split complex expressions into several parts to see which one worked (expected results) and then put them together again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Apr 2015 12:49:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Avg-of-aggregated-function/m-p/837309#M294459</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2015-04-15T12:49:40Z</dc:date>
    </item>
    <item>
      <title>Re: Avg of aggregated function</title>
      <link>https://community.qlik.com/t5/QlikView/Avg-of-aggregated-function/m-p/837310#M294460</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marcus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried the below however the second condition does not work it seems like. Do you have a clue what I might be doing wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;aggr&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;BR /&gt;&lt;BR /&gt;{&amp;lt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;SoD_Site&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = {'EEUHEE2XXXX'}, &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;SoD_SettlementOrder&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = {&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"$(=max(SoD_SettlementOrder))"&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;}&amp;gt;} &lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;SoD_RunningBalance&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;), &lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Apr 2015 14:46:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Avg-of-aggregated-function/m-p/837310#M294460</guid>
      <dc:creator />
      <dc:date>2015-04-27T14:46:18Z</dc:date>
    </item>
    <item>
      <title>Re: Avg of aggregated function</title>
      <link>https://community.qlik.com/t5/QlikView/Avg-of-aggregated-function/m-p/837311#M294461</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to make sure that &lt;SPAN style="color: #800000; font-size: 8pt;"&gt;SoD_SettlementOrder&lt;/SPAN&gt; is numeric and then you should have in mind that &lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"$(=max(SoD_SettlementOrder))"&lt;/SPAN&gt; will create a variable which could only have one value at a time and which will be calculated once for the whole chart and applied for each calculation on row-level.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Apr 2015 14:57:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Avg-of-aggregated-function/m-p/837311#M294461</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2015-04-27T14:57:09Z</dc:date>
    </item>
  </channel>
</rss>

