<?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: Inconsistency with aggregate expression results? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Inconsistency-with-aggregate-expression-results/m-p/1432884#M612737</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Again you need to calculate one more resident because Sum(Sum(Field)) not works even in SQL. You could use one more time &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 Nov 2017 11:52:28 GMT</pubDate>
    <dc:creator>Anil_Babu_Samineni</dc:creator>
    <dc:date>2017-11-21T11:52:28Z</dc:date>
    <item>
      <title>Inconsistency with aggregate expression results?</title>
      <link>https://community.qlik.com/t5/QlikView/Inconsistency-with-aggregate-expression-results/m-p/1432883#M612736</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;I have an aggregate expression my load script, which follows the basic logic below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;LOAD&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;Date&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;FieldA,&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;Sum(MetricA) AS MetricA,&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;Sum(MetricB) AS MetricB,&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;Sum(MetricA)/Sum(MetricB) AS MetricC&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;Resident CalculationTable&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;GROUP BY Date, FieldA&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I put this into a table, I find that MetricC does not equal MetricA/MetricB for about half of the rows. In fact, it is out by a factor of 10. I have been trying to figure this out and I am absolutely stumped. Are we able to use expressions with multiple aggregates as above or should I work around this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Nov 2017 11:43:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Inconsistency-with-aggregate-expression-results/m-p/1432883#M612736</guid>
      <dc:creator>pauluk__</dc:creator>
      <dc:date>2017-11-21T11:43:05Z</dc:date>
    </item>
    <item>
      <title>Re: Inconsistency with aggregate expression results?</title>
      <link>https://community.qlik.com/t5/QlikView/Inconsistency-with-aggregate-expression-results/m-p/1432884#M612737</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Again you need to calculate one more resident because Sum(Sum(Field)) not works even in SQL. You could use one more time &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Nov 2017 11:52:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Inconsistency-with-aggregate-expression-results/m-p/1432884#M612737</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2017-11-21T11:52:28Z</dc:date>
    </item>
    <item>
      <title>Re: Inconsistency with aggregate expression results?</title>
      <link>https://community.qlik.com/t5/QlikView/Inconsistency-with-aggregate-expression-results/m-p/1432885#M612738</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First thing I'd check is that the Date column is actually a date (or apply DayName() to it). If the underlying values include timestamps, your grouping will be off even if the end result table only displays the date portion of the stamp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not aware of any problems with the syntax above - sum(A)/Sum(B) shouldn't be an issue. That said, keep in mind that this will not aggregate to a weighted average in your charts later on - that might be a positive or a negative thing depending on what the metric represents.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Temp:&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; F1, F2, F3, F4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; A, A, 10, 10&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; A, A, 20, 20&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; A, A, 15, 30&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; A, B, 100, 100&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; A, B, 50, 200&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load F1, F2, sum(F3) as MetricA, sum(F4) as MetricB, Sum(F3)/Sum(F4) as MetricC&lt;/P&gt;&lt;P&gt;Resident Temp&lt;/P&gt;&lt;P&gt;GROUP BY F1, F2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop table Temp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/184019_pastedImage_0.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Nov 2017 11:53:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Inconsistency-with-aggregate-expression-results/m-p/1432885#M612738</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2017-11-21T11:53:49Z</dc:date>
    </item>
    <item>
      <title>Re: Inconsistency with aggregate expression results?</title>
      <link>https://community.qlik.com/t5/QlikView/Inconsistency-with-aggregate-expression-results/m-p/1432886#M612739</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Or. Unfortunately this was my mistake. I was doing another level of aggregation I had forgotten about. Thanks for the response though.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Nov 2017 16:34:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Inconsistency-with-aggregate-expression-results/m-p/1432886#M612739</guid>
      <dc:creator>pauluk__</dc:creator>
      <dc:date>2017-11-21T16:34:15Z</dc:date>
    </item>
  </channel>
</rss>

