<?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 expression giving wrong result in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Average-expression-giving-wrong-result/m-p/387352#M566604</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi kt_sesor,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The null value does not exist, does not see Qlikview and is averaging the three values ​​if you see.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe, serve you an arithmetic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum (SalesRevenue) / count (TOTAL DISTINCT salesmen)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 02 Jan 2013 15:38:57 GMT</pubDate>
    <dc:creator>montero91</dc:creator>
    <dc:date>2013-01-02T15:38:57Z</dc:date>
    <item>
      <title>Average expression giving wrong result</title>
      <link>https://community.qlik.com/t5/QlikView/Average-expression-giving-wrong-result/m-p/387348#M566600</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 seem to be having problems with the average function it is giving me incorrect data and I can't figure out why&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to average the sales revenue for each salesday, for all salesmen. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So my dimension is salesDay, and my expression avg(salesRevenue) and this is the table I get.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="0" cellspacing="0" class="jiveBorder" style="width: 500px; height: 100px; border: #000000 1px solid;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="text-align: left; background-color: transparent; font-family: Arial; color: #333333; padding: 0px;"&gt;&lt;/TD&gt;&lt;TD style="text-align: left; background-color: transparent; font-family: Arial; color: #333333; padding: 0px;"&gt;Day1&lt;/TD&gt;&lt;TD style="text-align: left; background-color: transparent; font-family: Arial; color: #333333; padding: 0px;"&gt;Day2&lt;/TD&gt;&lt;TD style="text-align: left; background-color: transparent; font-family: Arial; color: #333333; padding: 0px;"&gt;Day3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="text-align: left; background-color: transparent; font-family: Arial; color: #333333; padding: 0px;"&gt;Average Sales Revenue&lt;/TD&gt;&lt;TD style="text-align: left; background-color: transparent; font-family: Arial; color: #333333; padding: 0px;"&gt;1490&lt;/TD&gt;&lt;TD style="text-align: left; background-color: transparent; font-family: Arial; color: #333333; padding: 0px;"&gt;760&lt;/TD&gt;&lt;TD style="text-align: left; background-color: transparent; font-family: Arial; color: #333333; padding: 0px;"&gt;1210&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The result above does not match the data which is shown in the following table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="3" cellspacing="0" class="jiveBorder" style="width: 100%; border: 1px solid #000000;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;Day1&lt;/TD&gt;&lt;TD&gt;Day2&lt;/TD&gt;&lt;TD&gt;Day3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;John&lt;/TD&gt;&lt;TD&gt;1427&lt;/TD&gt;&lt;TD&gt;1865&lt;/TD&gt;&lt;TD&gt;2404&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Andrew&lt;/TD&gt;&lt;TD&gt;2778&lt;/TD&gt;&lt;TD&gt;1881&lt;/TD&gt;&lt;TD&gt;3015&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Matt&lt;/TD&gt;&lt;TD&gt;null&lt;/TD&gt;&lt;TD&gt;null&lt;/TD&gt;&lt;TD&gt;null&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Jen&lt;/TD&gt;&lt;TD&gt;315&lt;/TD&gt;&lt;TD&gt;-2558&lt;/TD&gt;&lt;TD&gt;-2970&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The averages should be-&lt;/P&gt;&lt;P&gt;day 1 - 1130&lt;/P&gt;&lt;P&gt;day 2 - 297&lt;/P&gt;&lt;P&gt;day 3 - 2449&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would be greatfull for any help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jan 2013 15:22:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-expression-giving-wrong-result/m-p/387348#M566600</guid>
      <dc:creator />
      <dc:date>2013-01-02T15:22:20Z</dc:date>
    </item>
    <item>
      <title>Re: Average expression giving wrong result</title>
      <link>https://community.qlik.com/t5/QlikView/Average-expression-giving-wrong-result/m-p/387349#M566601</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The average function disregards nulls, so it takes the sum of the three valid numbers and divides it by three. If you don't want that you could use sum(salesRevenue)/count(salesmen)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jan 2013 15:27:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-expression-giving-wrong-result/m-p/387349#M566601</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2013-01-02T15:27:50Z</dc:date>
    </item>
    <item>
      <title>Re: Average expression giving wrong result</title>
      <link>https://community.qlik.com/t5/QlikView/Average-expression-giving-wrong-result/m-p/387350#M566602</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks I considered this but it still doesn't explain the values qlikview gives. Excluding null values =&lt;/P&gt;&lt;P&gt;day 1-1506&lt;/P&gt;&lt;P&gt;day 2 -396&lt;/P&gt;&lt;P&gt;day 3- 816&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I replaced my avg formula with sum(salesRevenue)/count(salesmen) to double check but its still giving me the same wrong avg calculation.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jan 2013 15:34:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-expression-giving-wrong-result/m-p/387350#M566602</guid>
      <dc:creator />
      <dc:date>2013-01-02T15:34:28Z</dc:date>
    </item>
    <item>
      <title>Re: Average expression giving wrong result</title>
      <link>https://community.qlik.com/t5/QlikView/Average-expression-giving-wrong-result/m-p/387351#M566603</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks I considered this but it still doesn't explain the values qlikview gives. Excluding null values =&lt;/P&gt;&lt;P&gt;day 1-1506&lt;/P&gt;&lt;P&gt;day 2 -396&lt;/P&gt;&lt;P&gt;day 3- 816&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I replaced my avg formula with sum(salesRevenue)/count(salesmen) to double check but its still giving me the same wrong avg calculation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;could the error be in the second table and the data it is displaying?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jan 2013 15:35:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-expression-giving-wrong-result/m-p/387351#M566603</guid>
      <dc:creator />
      <dc:date>2013-01-02T15:35:09Z</dc:date>
    </item>
    <item>
      <title>Re: Average expression giving wrong result</title>
      <link>https://community.qlik.com/t5/QlikView/Average-expression-giving-wrong-result/m-p/387352#M566604</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi kt_sesor,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The null value does not exist, does not see Qlikview and is averaging the three values ​​if you see.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe, serve you an arithmetic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum (SalesRevenue) / count (TOTAL DISTINCT salesmen)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jan 2013 15:38:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-expression-giving-wrong-result/m-p/387352#M566604</guid>
      <dc:creator>montero91</dc:creator>
      <dc:date>2013-01-02T15:38:57Z</dc:date>
    </item>
    <item>
      <title>Re: Average expression giving wrong result</title>
      <link>https://community.qlik.com/t5/QlikView/Average-expression-giving-wrong-result/m-p/387353#M566605</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks every on for your help, after breaking the issue down further I've found it was to do with my load script.&lt;/P&gt;&lt;P&gt;One sales man can have 2 different instances of sales revenue if they are from two different regions so it was averaged up by that. I think the best option for me is to separate the region from the main data load. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jan 2013 09:20:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-expression-giving-wrong-result/m-p/387353#M566605</guid>
      <dc:creator />
      <dc:date>2013-01-03T09:20:22Z</dc:date>
    </item>
    <item>
      <title>Re: Average expression giving wrong result</title>
      <link>https://community.qlik.com/t5/QlikView/Average-expression-giving-wrong-result/m-p/387354#M566606</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;why are we using &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;TOTAL DISTINCT ???&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;can you please explain the expression&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Nov 2013 12:10:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-expression-giving-wrong-result/m-p/387354#M566606</guid>
      <dc:creator />
      <dc:date>2013-11-05T12:10:10Z</dc:date>
    </item>
    <item>
      <title>Re: Average expression giving wrong result</title>
      <link>https://community.qlik.com/t5/QlikView/Average-expression-giving-wrong-result/m-p/387355#M566607</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kerthi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: 'Trebuchet MS','sans-serif'; color: black;"&gt;Ya que únicamente tenemos tres vendedores que tienen venta, Qlikview realiza un promedio de tres clientes. Suma y lo divide entre tres y tienes como resultado 1506.667.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: 'Trebuchet MS','sans-serif'; color: black;"&gt;Y lo que se espera es el promedio por lo cuatro vendedores.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: 'Trebuchet MS','sans-serif'; color: black;"&gt;Y como resultado del&amp;nbsp; count (TOTAL DISTINCT salesmen) te da como resultado 4 para todos los&amp;nbsp; vendedores.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: 'Trebuchet MS','sans-serif'; color: black;"&gt;Sin el Distinct corremos el riesgo de que un vendedor tenga más de una venta por lo que se repetiría el vendedor y el TOTAL es por la dimensión, ya quiero que el total de los vendedores en todos los renglones si pones count( distinct salesmen) el resultado en John seria 1.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 0 0 1.0pt 0;"&gt;&lt;SPAN lang="EN-US" style="font-family: 'Trebuchet MS','sans-serif'; color: black;"&gt;Con esto tenemos la venta por vendedor entre el número total de vendedores teniendo como resultado Dia1 4520 / 4 vendedores y un promedio aritmético de 1130 que es al que se quiere llegar.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 0 0 1.0pt 0;"&gt;&lt;SPAN lang="EN-US" style="font-family: 'Trebuchet MS','sans-serif'; color: black;"&gt;---------------------------------------------&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: 'Trebuchet MS','sans-serif'; color: black;"&gt;Since we only have three salesmen who sell, QlikView makes an average of three customers. Sum and divide three to have resulted 1506,667.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: 'Trebuchet MS','sans-serif'; color: black;"&gt;And the average expected is at four salesmen.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: 'Trebuchet MS','sans-serif'; color: black;"&gt;As a result of the count (DISTINCT TOTAL salesmen) will result is 4 for all salesmen.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: 'Trebuchet MS','sans-serif'; color: black;"&gt;Without Distinct run the risk that a seller has more than one sale so it would repeat the seller and the "TOTAL" is the dimension, and I want the total salesman in all lines if you put count (distinct salesmen) , the John would result in 1.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: 'Trebuchet MS','sans-serif'; color: black;"&gt;With this we have for sale by seller between the total number of salesmen resulting Dia1 4520/4 salesman and an arithmetic average is 1130 which is i want.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: 'Trebuchet MS','sans-serif'; color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: 'Trebuchet MS','sans-serif'; color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="639"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl65" height="39" width="72"&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="72"&gt;Día 1&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="246"&gt;TOTAL salesmen with Total Distinct&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="72"&gt;Without TOTAL&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="72"&gt;Without Distinct&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="105"&gt;Arithmetic AVG. With TOTAL Distinct&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="23" style="border-top: none;" width="72"&gt;Juan&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;" width="72"&gt;1427&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;" width="246"&gt;4&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;" width="72"&gt;1&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;" width="72"&gt;2&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;" width="105"&gt;356.75&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="23" style="border-top: none;" width="72"&gt;Andrés&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;" width="72"&gt;2778&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;" width="246"&gt;4&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;" width="72"&gt;1&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;" width="72"&gt;4&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;" width="105"&gt;694.5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="23" style="border-top: none;" width="72"&gt;Mate&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;" width="72"&gt;nulo&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;" width="246"&gt;4&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;" width="72"&gt;1&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;" width="72"&gt;0&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;" width="105"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="23" style="border-top: none;" width="72"&gt;Jen&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;" width="72"&gt;315&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;" width="246"&gt;4&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;" width="72"&gt;1&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;" width="72"&gt;6&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;" width="105"&gt;78.75&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="25" width="72"&gt;Total&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;" width="72"&gt;4520&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;" width="246"&gt;4&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;" width="72"&gt;3&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;" width="72"&gt;12&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;" width="105"&gt;&lt;STRONG&gt;1130&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Nov 2013 22:13:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-expression-giving-wrong-result/m-p/387355#M566607</guid>
      <dc:creator>montero91</dc:creator>
      <dc:date>2013-11-11T22:13:04Z</dc:date>
    </item>
  </channel>
</rss>

