<?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: Aggr() with drill down in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Aggr-with-drill-down/m-p/130086#M19581</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe your real word problem is more complex, but it should also be sufficient to use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Avg( Aggr( Sum(Time), Stage, TEAM,Name ) )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;edit:&lt;/P&gt;&lt;P&gt;Or even &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Avg( Aggr( Sum(Time), Stage, Name ) )&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 23 Oct 2018 17:15:03 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2018-10-23T17:15:03Z</dc:date>
    <item>
      <title>Aggr() with drill down</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-with-drill-down/m-p/130084#M19579</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;Please find attached some sample data; I'm struggling to get the syntax right for this aggr() expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Intention is to sum Time in each stage per Name and show the average of time in stage at higher levels of aggregation (in real world there are multiple hierarchical levels and some set analysis, in the example just 'TEAM'). Currently I have:&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;Avg( Aggr( Sum(Time), Stage, $(=GetCurrentField([Hierarchy])) ) )&lt;/STRONG&gt;&lt;SPAN style="font-size: 13.3333px;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The desired result:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="74" jive-data-cell="{&amp;quot;color&amp;quot;:&amp;quot;#575757&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;left&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;2&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;transparent&amp;quot;,&amp;quot;fontFamily&amp;quot;:&amp;quot;arial,helvetica,sans-serif&amp;quot;,&amp;quot;verticalAlign&amp;quot;:&amp;quot;baseline&amp;quot;}" jive-data-header="{&amp;quot;color&amp;quot;:&amp;quot;#FFFFFF&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;#6690BC&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;center&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;2&amp;quot;,&amp;quot;fontFamily&amp;quot;:&amp;quot;arial,helvetica,sans-serif&amp;quot;,&amp;quot;verticalAlign&amp;quot;:&amp;quot;baseline&amp;quot;}" style="border: 1px solid #000000; width: 379px; height: 68px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px; width: 73px;" valign="middle"&gt;&lt;STRONG&gt;TEAM&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px; width: 64px;" valign="middle"&gt;&lt;STRONG&gt;A&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px; width: 20%;" valign="middle"&gt;&lt;STRONG&gt;B&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px; width: 37px;" valign="middle"&gt;&lt;STRONG&gt;C&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;X&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;23.5&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;8&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;Y&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;6&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;10&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and (drilling down from X):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="74" jive-data-cell="{&amp;quot;color&amp;quot;:&amp;quot;#000000&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;left&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;2&amp;quot;}" jive-data-header="{&amp;quot;color&amp;quot;:&amp;quot;#FFFFFF&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;#6690BC&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;center&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;2&amp;quot;,&amp;quot;fontFamily&amp;quot;:&amp;quot;arial,helvetica,sans-serif&amp;quot;,&amp;quot;verticalAlign&amp;quot;:&amp;quot;baseline&amp;quot;}" style="border: 1px solid rgb(0, 0, 0); width: 381px; height: 65px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px; width: 110px;" valign="middle"&gt;&lt;STRONG&gt;Name&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px; width: 88px;" valign="middle"&gt;&lt;STRONG&gt;A&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px; width: 133px;" valign="middle"&gt;&lt;STRONG&gt;B&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px; width: 229px;" valign="middle"&gt;&lt;STRONG&gt;C&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;Bill&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;30&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;9&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;Harry&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;17&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;7&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be great,&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Rutger&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Oct 2018 16:52:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-with-drill-down/m-p/130084#M19579</guid>
      <dc:creator>rutger_jansen</dc:creator>
      <dc:date>2018-10-23T16:52:14Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr() with drill down</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-with-drill-down/m-p/130085#M19580</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Avg( Aggr( Sum(Time), Stage, $(=GetCurrentField([Hierarchy])) ) )/Count(DISTINCT Name)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Oct 2018 16:59:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-with-drill-down/m-p/130085#M19580</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-10-23T16:59:52Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr() with drill down</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-with-drill-down/m-p/130086#M19581</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe your real word problem is more complex, but it should also be sufficient to use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Avg( Aggr( Sum(Time), Stage, TEAM,Name ) )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;edit:&lt;/P&gt;&lt;P&gt;Or even &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Avg( Aggr( Sum(Time), Stage, Name ) )&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Oct 2018 17:15:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-with-drill-down/m-p/130086#M19581</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2018-10-23T17:15:03Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr() with drill down</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-with-drill-down/m-p/130087#M19582</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks very much Sunny! (I had to remove the inner '=' for it to work in the real example but yours worked in the sample)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Oct 2018 17:23:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-with-drill-down/m-p/130087#M19582</guid>
      <dc:creator>rutger_jansen</dc:creator>
      <dc:date>2018-10-23T17:23:07Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr() with drill down</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-with-drill-down/m-p/130088#M19583</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Stefan, much appreciated. I prefer this answer because I didn't really understand why the avg() needed to be divided by a count (though it worked!?).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Oct 2018 17:37:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-with-drill-down/m-p/130088#M19583</guid>
      <dc:creator>rutger_jansen</dc:creator>
      <dc:date>2018-10-23T17:37:38Z</dc:date>
    </item>
  </channel>
</rss>

