<?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 AGGR() calculating wrong results in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/AGGR-calculating-wrong-results/m-p/264106#M499228</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; The difference is becasue the Product Category selection in the expression Vmedian_1 is respected &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;your&amp;nbsp; expression is "Median(aggr(sum(x),employeeid))"&amp;nbsp; so this will disregard the Dimension Product Category which &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you have taken in the chart But if you select that dimension in the list box&amp;nbsp; this Expression will be calculated &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for that selection also . this is the reason for change in the result &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 07 Jun 2011 06:26:39 GMT</pubDate>
    <dc:creator>qliksus</dc:creator>
    <dc:date>2011-06-07T06:26:39Z</dc:date>
    <item>
      <title>AGGR() calculating wrong results</title>
      <link>https://community.qlik.com/t5/QlikView/AGGR-calculating-wrong-results/m-p/264103#M499225</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I used AGGR() to answer two questions from a dataset with 3.1 million rows and got inaccurate results. Also, the results change with different selections, when I would expect them to stay the same within a given dimension. The questions were: &lt;EM&gt;for each product, 1) what is the average premium per employee and 2) what is the medial premium per employee&lt;/EM&gt;. It sounded like a good case for AGGR().&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The application is too large to upload but here are screenshots. (When I reduce the application, all versions of the expressions start to provide the same result. It's only with the full data that I see these unexpected results.) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note the expressions in the variable input box. The _1 version is what I used initially but gave wrong results. The _2 version gave the correct answer, but it requires that the expression include all the chart dimensions, which does not seem correct to me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first screenshot shows the average and median calculated various ways, with the expressions above in an input box. The correct MEAN amount is represented by the 3rd and 5th expression columns. The correct MEDIAN is shown in the final column. This is based on calculations provided separately by Excel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Scrn1.png" class="jive-image-thumbnail jive-image" onclick="" src="https://community.qlik.com/legacyfs/online/5056_Scrn1.png" width="450" /&gt;&lt;/P&gt;&lt;P&gt;The second shows the result of selection the first value in Product Catg. Notice how the calculations using AGGR() changed from the no-selections version:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Scrn2.png" class="jive-image-thumbnail jive-image" onclick="" src="https://community.qlik.com/legacyfs/online/5060_Scrn2.png" width="450" /&gt;&lt;/P&gt;&lt;P&gt;I really need to solve this, because AGGR() seemed quite promising for these kinds of calculations - if I can get it work correctly.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jun 2011 22:15:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/AGGR-calculating-wrong-results/m-p/264103#M499225</guid>
      <dc:creator>jcarpenter9</dc:creator>
      <dc:date>2011-06-03T22:15:04Z</dc:date>
    </item>
    <item>
      <title>AGGR() calculating wrong results</title>
      <link>https://community.qlik.com/t5/QlikView/AGGR-calculating-wrong-results/m-p/264104#M499226</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Still no answer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jun 2011 02:48:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/AGGR-calculating-wrong-results/m-p/264104#M499226</guid>
      <dc:creator />
      <dc:date>2011-06-07T02:48:26Z</dc:date>
    </item>
    <item>
      <title>AGGR() calculating wrong results</title>
      <link>https://community.qlik.com/t5/QlikView/AGGR-calculating-wrong-results/m-p/264105#M499227</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;With regards to your _2 statement about having to include all the columns. This is correct. By design, Aggr() ignores the chart dimensions. It is correct that you must list all dimensions to be used by aggr().&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;P&gt;&lt;A href="http://robwunderlich.com/"&gt;http://robwunderlich.com/&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jun 2011 05:40:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/AGGR-calculating-wrong-results/m-p/264105#M499227</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2011-06-07T05:40:07Z</dc:date>
    </item>
    <item>
      <title>AGGR() calculating wrong results</title>
      <link>https://community.qlik.com/t5/QlikView/AGGR-calculating-wrong-results/m-p/264106#M499228</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; The difference is becasue the Product Category selection in the expression Vmedian_1 is respected &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;your&amp;nbsp; expression is "Median(aggr(sum(x),employeeid))"&amp;nbsp; so this will disregard the Dimension Product Category which &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you have taken in the chart But if you select that dimension in the list box&amp;nbsp; this Expression will be calculated &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for that selection also . this is the reason for change in the result &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jun 2011 06:26:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/AGGR-calculating-wrong-results/m-p/264106#M499228</guid>
      <dc:creator>qliksus</dc:creator>
      <dc:date>2011-06-07T06:26:39Z</dc:date>
    </item>
  </channel>
</rss>

