<?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 by dimension in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Average-by-dimension/m-p/700856#M1057984</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you know if there is a way of putting an expression for each dimension. For example for dimension 1, calculate the average on this way, for dimension 2 on this way etc?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 13 Oct 2014 06:53:23 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-10-13T06:53:23Z</dc:date>
    <item>
      <title>Average by dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Average-by-dimension/m-p/700855#M1057981</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello again,&lt;/P&gt;&lt;P&gt;here is my problem&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this table: &lt;/P&gt;&lt;P&gt;&lt;IMG alt="moyenne.png" class="jive-image" src="https://community.qlik.com/legacyfs/online/68678_moyenne.png" style="width: 620px; height: 387px;" /&gt;&lt;/P&gt;&lt;P&gt;for the colum circled in red, I need to take the mean of some values.&lt;/P&gt;&lt;P&gt;The first dimension is the commercial, the second dimension the customer and the third dimension the order number. The last dimension is not usefull and will be deleted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For my statistics, I need to take the average of the quotes (total amounts of quotes / number of quotes) which will be written as the amount in € of the order.&lt;/P&gt;&lt;P&gt;After that I need to take the average of the orders per customer (total amount in € of the MEANS of the orders / amount of orders) as the mean value per customer.&lt;/P&gt;&lt;P&gt;Finally I need to take the average of all the customers (total amount in € of the MEANS of customets / amount of customers).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Until now I have this expression for that column:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;avg(aggr(sum(aggr(if(count({&amp;lt;JD_DATE=, JD_NDEVIS=P(JD_NDEVIS), JD_NVARIANT_FABR={1}&amp;gt;} JD_CODUNIQ) = count ({&amp;lt;JD_DATE=, JD_NDEVIS=P(JD_NDEVIS)&amp;gt;} JD_CODUNIQ), &lt;/P&gt;&lt;P&gt;avg({&amp;lt;JD_NVARIANT_FABR={1}, JD_DATE=, JD_NDEVIS=P(JD_NDEVIS)&amp;gt;}JD_PX_TOTAL),&lt;/P&gt;&lt;P&gt;avg({&amp;lt;JD_NVARIANT_COMM={1},JD_DATE=, JD_NDEVIS=P(JD_NDEVIS)&amp;gt;}JD_PX_TOTAL)), JD_NDEVIS)), JD_NDEVIS))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The condition for the if is not important for the understanding of the problem and the trued anf false value either.&lt;/P&gt;&lt;P&gt;JD_NVARIANT= quote of the order&lt;/P&gt;&lt;P&gt;JD_NDEVIS= order number&lt;/P&gt;&lt;P&gt;JD_PX_TOTAL= value of the quote&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is that in this table, the mean per order is correct, and also per customer, but when it comes to the mean of the commercial, it doesn't calculate it correctly. What it does now, is taking all the orders values and dividing them by the number of orders instead of taking all the values of the customers and divide it by the number of customers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone see what's wring in my expression? I tried several things with avg, sum, aggr etc &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Oct 2014 12:06:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-by-dimension/m-p/700855#M1057981</guid>
      <dc:creator />
      <dc:date>2014-10-10T12:06:22Z</dc:date>
    </item>
    <item>
      <title>Re: Average by dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Average-by-dimension/m-p/700856#M1057984</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you know if there is a way of putting an expression for each dimension. For example for dimension 1, calculate the average on this way, for dimension 2 on this way etc?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Oct 2014 06:53:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-by-dimension/m-p/700856#M1057984</guid>
      <dc:creator />
      <dc:date>2014-10-13T06:53:23Z</dc:date>
    </item>
  </channel>
</rss>

