<?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 calculations in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Average-calculations/m-p/1362873#M417483</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P class=""&gt;If you do sum()/count() instead of avg(), do you get same result?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 17 May 2017 18:20:07 GMT</pubDate>
    <dc:creator>RSvebeck</dc:creator>
    <dc:date>2017-05-17T18:20:07Z</dc:date>
    <item>
      <title>Average calculations</title>
      <link>https://community.qlik.com/t5/QlikView/Average-calculations/m-p/1362868#M417478</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;Could someone please explain to me why my averages at different levels would be different. Should the sum of the months, divided by 3 equal the quarter and so on?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;SPAN style="color: #0000ff;"&gt;aggr&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;avg&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;EmpCt_ZEMPCT&lt;/SPAN&gt;),&lt;SPAN style="color: #800000;"&gt;[Profit Center]&lt;/SPAN&gt;,&lt;SPAN style="color: #800000;"&gt;FISYR&lt;/SPAN&gt;,&lt;SPAN style="color: #800000;"&gt;FISPD&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;)) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;I get the following for months: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Jan&amp;nbsp;&amp;nbsp;&amp;nbsp; 7,780&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Feb&amp;nbsp;&amp;nbsp; 7,898&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Mar&amp;nbsp;&amp;nbsp; 8,285&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;I get the following for QTR: &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;aggr&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;avg&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;EmpCt_ZEMPCT&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Profit Center]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;FISYR&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;QTR&lt;/SPAN&gt;&lt;SPAN&gt;)) &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;QTR 1&amp;nbsp;&amp;nbsp;&amp;nbsp; 8,140&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;aggr&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;avg&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;EmpCt_ZEMPCT&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Profit Center]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;FISYR&lt;/SPAN&gt;&lt;SPAN&gt;)) &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;Year:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;8,365&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 May 2017 15:41:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-calculations/m-p/1362868#M417478</guid>
      <dc:creator>tmumaw</dc:creator>
      <dc:date>2017-05-17T15:41:50Z</dc:date>
    </item>
    <item>
      <title>Re: Average calculations</title>
      <link>https://community.qlik.com/t5/QlikView/Average-calculations/m-p/1362869#M417479</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ma be TOTAL Keyword for Average, If not may be needful bit clarification&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 May 2017 15:57:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-calculations/m-p/1362869#M417479</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2017-05-17T15:57:01Z</dc:date>
    </item>
    <item>
      <title>Re: Average calculations</title>
      <link>https://community.qlik.com/t5/QlikView/Average-calculations/m-p/1362870#M417480</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nope&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 May 2017 17:15:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-calculations/m-p/1362870#M417480</guid>
      <dc:creator>tmumaw</dc:creator>
      <dc:date>2017-05-17T17:15:56Z</dc:date>
    </item>
    <item>
      <title>Re: Average calculations</title>
      <link>https://community.qlik.com/t5/QlikView/Average-calculations/m-p/1362871#M417481</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P class=""&gt;Do you have zero, null or negative values among those you do avg() around?&lt;/P&gt;&lt;P class=""&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P class=""&gt;Robert&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 May 2017 18:11:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-calculations/m-p/1362871#M417481</guid>
      <dc:creator>RSvebeck</dc:creator>
      <dc:date>2017-05-17T18:11:16Z</dc:date>
    </item>
    <item>
      <title>Re: Average calculations</title>
      <link>https://community.qlik.com/t5/QlikView/Average-calculations/m-p/1362872#M417482</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nope&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 May 2017 18:15:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-calculations/m-p/1362872#M417482</guid>
      <dc:creator>tmumaw</dc:creator>
      <dc:date>2017-05-17T18:15:33Z</dc:date>
    </item>
    <item>
      <title>Re: Average calculations</title>
      <link>https://community.qlik.com/t5/QlikView/Average-calculations/m-p/1362873#M417483</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P class=""&gt;If you do sum()/count() instead of avg(), do you get same result?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 May 2017 18:20:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-calculations/m-p/1362873#M417483</guid>
      <dc:creator>RSvebeck</dc:creator>
      <dc:date>2017-05-17T18:20:07Z</dc:date>
    </item>
    <item>
      <title>Re: Average calculations</title>
      <link>https://community.qlik.com/t5/QlikView/Average-calculations/m-p/1362874#M417484</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P class=""&gt;I try to avoid avg()&lt;/P&gt;&lt;P class=""&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P class=""&gt;read this&lt;/P&gt;&lt;P class=""&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/blogs/qlikviewdesignblog/2013/07/29/averages"&gt;https://community.qlik.com/blogs/qlikviewdesignblog/2013/07/29/averages&lt;/A&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;BR /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 May 2017 18:25:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-calculations/m-p/1362874#M417484</guid>
      <dc:creator>RSvebeck</dc:creator>
      <dc:date>2017-05-17T18:25:09Z</dc:date>
    </item>
    <item>
      <title>Re: Average calculations</title>
      <link>https://community.qlik.com/t5/QlikView/Average-calculations/m-p/1362875#M417485</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Robert,&lt;/P&gt;&lt;P&gt;Take a look at the attached file.&amp;nbsp; I have employee counts (EmpCt_ZEMPCT) for every week.&amp;nbsp; Along with that I have employees which have been terminated during the same time period (FISYR, QTR, FISPD and WKNO).&amp;nbsp; You can see why I used the aggr(Avg)..&amp;nbsp; What is weird it works at the Profit Center level, but as I roll it up to higher levels it doesn't.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/163802_pastedImage_0.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 May 2017 18:47:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-calculations/m-p/1362875#M417485</guid>
      <dc:creator>tmumaw</dc:creator>
      <dc:date>2017-05-17T18:47:17Z</dc:date>
    </item>
    <item>
      <title>Re: Average calculations</title>
      <link>https://community.qlik.com/t5/QlikView/Average-calculations/m-p/1362876#M417486</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P class=""&gt;Sure, I can have a look, but you still should avoid avg() almost always, it is slower and as &lt;A _jive_internal="true" class="jive_macro jive-link-profile-small jive_macro_user" href="https://community.qlik.com/people/hic"&gt;Henric Cronström&lt;/A&gt;&amp;nbsp;writes:&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN style="-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);"&gt;Avg() function returns the average value, but – this is usually not the value that you want.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN style="-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN style="-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);"&gt;The Avg() function returns the average&amp;nbsp;&lt;/SPAN&gt;&lt;EM style="-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);"&gt;transactional&amp;nbsp;&lt;/EM&gt;&lt;SPAN style="-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);"&gt;value, whereas you probably are looking for a larger amount.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN style="-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN style="-webkit-text-size-adjust: auto;"&gt;Use sum()/count(), it is what you are after normally.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN style="-webkit-text-size-adjust: auto;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN style="-webkit-text-size-adjust: auto;"&gt;Robert&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 May 2017 18:52:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-calculations/m-p/1362876#M417486</guid>
      <dc:creator>RSvebeck</dc:creator>
      <dc:date>2017-05-17T18:52:31Z</dc:date>
    </item>
    <item>
      <title>Re: Average calculations</title>
      <link>https://community.qlik.com/t5/QlikView/Average-calculations/m-p/1362877#M417487</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P class=""&gt;ok Ihad a look, and difference is explained by the fact that avg() is average on profit center level all the time, even when you go on higer level, and then you get an sort of avgerage sum of averages instead of just average on higher levels.&lt;/P&gt;&lt;P class=""&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P class=""&gt;Avoid this problem by using sum()/count()&lt;/P&gt;&lt;P class=""&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P class=""&gt;That will always work, regardless of level, and it is faster for qlik to calculate.&lt;/P&gt;&lt;P class=""&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P class=""&gt;Robert&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 May 2017 19:08:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-calculations/m-p/1362877#M417487</guid>
      <dc:creator>RSvebeck</dc:creator>
      <dc:date>2017-05-17T19:08:31Z</dc:date>
    </item>
    <item>
      <title>Re: Average calculations</title>
      <link>https://community.qlik.com/t5/QlikView/Average-calculations/m-p/1362878#M417488</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your help Robert.&amp;nbsp; I think I just needed to go home and sleep on it.&amp;nbsp; I changed everything per your suggestion and it worked.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 May 2017 15:09:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-calculations/m-p/1362878#M417488</guid>
      <dc:creator>tmumaw</dc:creator>
      <dc:date>2017-05-18T15:09:54Z</dc:date>
    </item>
  </channel>
</rss>

