<?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: Issues using the &amp;quot;Avg&amp;quot; function in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Issues-using-the-quot-Avg-quot-function/m-p/495904#M483026</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Null values are disregarded by the avg function. So if a record doesn't have a value that record will not be included to calculate the average. That is correct imo, but it may not be what you want. In that case you can divide the sum by the count, i.e. sum(units)/count(units). Or you can try to replace the nulls in the script with real values.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 18 Jul 2013 13:58:03 GMT</pubDate>
    <dc:creator>Gysbert_Wassenaar</dc:creator>
    <dc:date>2013-07-18T13:58:03Z</dc:date>
    <item>
      <title>Issues using the "Avg" function</title>
      <link>https://community.qlik.com/t5/QlikView/Issues-using-the-quot-Avg-quot-function/m-p/495903#M483025</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Has anybody experienced any issues using the avg function within Qlikview? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have created a straight table containing 14 lines of data (by date) for a number of fields 'units' 'visits' &amp;amp; 'conversions' (units/visits)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have some text boxes that will display summarised values, the text boxes containing sum("fieldname") are fine but those with avg("fieldname") are not producing the correct values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sure I am missing something straightforward or simple somewhere but I cannot seem to fathom it out - can anybody help??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(Unfortunately due to business constraints I cannot post the app - but a screenshot demonstrating the prob is below)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="jiveImage" src="https://community.qlik.com/" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jul 2013 13:55:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Issues-using-the-quot-Avg-quot-function/m-p/495903#M483025</guid>
      <dc:creator />
      <dc:date>2013-07-18T13:55:23Z</dc:date>
    </item>
    <item>
      <title>Re: Issues using the "Avg" function</title>
      <link>https://community.qlik.com/t5/QlikView/Issues-using-the-quot-Avg-quot-function/m-p/495904#M483026</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Null values are disregarded by the avg function. So if a record doesn't have a value that record will not be included to calculate the average. That is correct imo, but it may not be what you want. In that case you can divide the sum by the count, i.e. sum(units)/count(units). Or you can try to replace the nulls in the script with real values.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jul 2013 13:58:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Issues-using-the-quot-Avg-quot-function/m-p/495904#M483026</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2013-07-18T13:58:03Z</dc:date>
    </item>
    <item>
      <title>Re: Issues using the "Avg" function</title>
      <link>https://community.qlik.com/t5/QlikView/Issues-using-the-quot-Avg-quot-function/m-p/495905#M483027</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Gysbert thats useful to know&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However not sure that is the problem in this case: if you look at the screenshot (now attached) you should be able to see that for the current selection there is no null values! That's what is baffling me&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="44215" class="jive-image-thumbnail jive-image" height="232" onclick="" alt="Capture.PNG" src="https://community.qlik.com/legacyfs/online/44215_Capture.PNG" width="449" /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="jiveImage" src="https://community.qlik.com/" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jul 2013 14:12:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Issues-using-the-quot-Avg-quot-function/m-p/495905#M483027</guid>
      <dc:creator />
      <dc:date>2013-07-18T14:12:22Z</dc:date>
    </item>
    <item>
      <title>Re: Issues using the "Avg" function</title>
      <link>https://community.qlik.com/t5/QlikView/Issues-using-the-quot-Avg-quot-function/m-p/495906#M483028</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, and? What's the result you're expecting? Do you want an average of the sums instead of an average of the actual values themselves? In that case try avg(aggr(sum(units),date))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jul 2013 14:36:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Issues-using-the-quot-Avg-quot-function/m-p/495906#M483028</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2013-07-18T14:36:10Z</dc:date>
    </item>
  </channel>
</rss>

