<?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: Average of sum in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Average-of-sum/m-p/469723#M1149797</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is a nested aggregation. You first want to sum the costs per inspection. Then you want to calculate some average. For instance the average cost per inspection would be&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum(Cost)/Count(distinct Inspection)&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Avg(Aggr(Sum(Cost), Inspection))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How you want the number of hours to influence the calculation I am not sure. Perhaps&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum(Cost)/Sum(Hours)&lt;/P&gt;&lt;P&gt;and use Inspection as dimension? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HIC &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 13 Jun 2013 10:09:01 GMT</pubDate>
    <dc:creator>hic</dc:creator>
    <dc:date>2013-06-13T10:09:01Z</dc:date>
    <item>
      <title>Average of sum</title>
      <link>https://community.qlik.com/t5/QlikView/Average-of-sum/m-p/469721#M1149795</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am looking for one way to get an average of sum. I tried avg(sum(fieldname)) and in return I got only 0.&lt;/P&gt;&lt;P&gt;In my example I got car inspeccions done and I want to know in average how much I do by hour for instance.&lt;/P&gt;&lt;P&gt;My data is loaded inspeccion by inspeccion and has got all the information concerning the exact time it is done.&lt;/P&gt;&lt;P&gt;thanks in advance for the help,&lt;/P&gt;&lt;P&gt;afonso&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jun 2013 09:55:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-of-sum/m-p/469721#M1149795</guid>
      <dc:creator />
      <dc:date>2013-06-13T09:55:43Z</dc:date>
    </item>
    <item>
      <title>Re: Average of sum</title>
      <link>https://community.qlik.com/t5/QlikView/Average-of-sum/m-p/469722#M1149796</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could use the aggr function. Let's say you want to calc the avg of some sum per hour that would be&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;avg(aggr(sum(Fieldname),HourFieldname))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The aggr function gives you a list of values calculated by HourFieldname, which you then calculates the avg of. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jun 2013 10:07:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-of-sum/m-p/469722#M1149796</guid>
      <dc:creator>jfkinspari</dc:creator>
      <dc:date>2013-06-13T10:07:05Z</dc:date>
    </item>
    <item>
      <title>Re: Average of sum</title>
      <link>https://community.qlik.com/t5/QlikView/Average-of-sum/m-p/469723#M1149797</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is a nested aggregation. You first want to sum the costs per inspection. Then you want to calculate some average. For instance the average cost per inspection would be&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum(Cost)/Count(distinct Inspection)&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Avg(Aggr(Sum(Cost), Inspection))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How you want the number of hours to influence the calculation I am not sure. Perhaps&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum(Cost)/Sum(Hours)&lt;/P&gt;&lt;P&gt;and use Inspection as dimension? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HIC &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jun 2013 10:09:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-of-sum/m-p/469723#M1149797</guid>
      <dc:creator>hic</dc:creator>
      <dc:date>2013-06-13T10:09:01Z</dc:date>
    </item>
    <item>
      <title>Re: Average of sum</title>
      <link>https://community.qlik.com/t5/QlikView/Average-of-sum/m-p/469724#M1149798</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;Aggr(Sum(Cost), Inspection) / Count(distinct Inspection)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jun 2013 10:20:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-of-sum/m-p/469724#M1149798</guid>
      <dc:creator />
      <dc:date>2013-06-13T10:20:55Z</dc:date>
    </item>
    <item>
      <title>Re: Average of sum</title>
      <link>https://community.qlik.com/t5/QlikView/Average-of-sum/m-p/469725#M1149799</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks for your tip.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried using aggr function but it didn't work as I was expecting. I end up dividing sum (receptions) by count (distinct calendardate) and it work perfectly.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jun 2013 14:52:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-of-sum/m-p/469725#M1149799</guid>
      <dc:creator />
      <dc:date>2013-06-13T14:52:26Z</dc:date>
    </item>
  </channel>
</rss>

