<?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 vs SET ANALYSIS why do my numbers differ in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/AGGR-vs-SET-ANALYSIS-why-do-my-numbers-differ/m-p/264122#M1205650</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am investigating the use of the AGGR function, but the values returned dont seem to be what i expect&lt;/P&gt;&lt;P&gt;the following expression&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;B&gt;count&lt;/B&gt;({&amp;lt;&lt;B&gt;Month&lt;/B&gt; = {'May 2010'}, &lt;B&gt;EmpStatus&lt;/B&gt; = {'Active'}&amp;gt;} &lt;B&gt;[Employee NO]&lt;/B&gt;)&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;returns 7895&lt;/P&gt;&lt;P&gt;I try and do the same with AGGR using&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=&lt;/P&gt;&lt;P&gt;&lt;B&gt;count&lt;/B&gt;(&lt;B&gt;aggr&lt;/B&gt;(&lt;B&gt;if&lt;/B&gt;(&lt;B&gt;EmpStatus&lt;/B&gt;= 'Active', &lt;B&gt;if&lt;/B&gt;(&lt;B&gt;Month&lt;/B&gt; = &lt;B&gt;ScorecardMonth&lt;/B&gt;, &lt;B&gt;[Employee NO]&lt;/B&gt;)),&lt;B&gt;[Employee NO]&lt;/B&gt;))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;But this only gives me 718?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;7895 is the right answer, where i am i going wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 29 Jun 2010 17:15:31 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-06-29T17:15:31Z</dc:date>
    <item>
      <title>AGGR vs SET ANALYSIS why do my numbers differ</title>
      <link>https://community.qlik.com/t5/QlikView/AGGR-vs-SET-ANALYSIS-why-do-my-numbers-differ/m-p/264122#M1205650</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am investigating the use of the AGGR function, but the values returned dont seem to be what i expect&lt;/P&gt;&lt;P&gt;the following expression&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;B&gt;count&lt;/B&gt;({&amp;lt;&lt;B&gt;Month&lt;/B&gt; = {'May 2010'}, &lt;B&gt;EmpStatus&lt;/B&gt; = {'Active'}&amp;gt;} &lt;B&gt;[Employee NO]&lt;/B&gt;)&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;returns 7895&lt;/P&gt;&lt;P&gt;I try and do the same with AGGR using&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=&lt;/P&gt;&lt;P&gt;&lt;B&gt;count&lt;/B&gt;(&lt;B&gt;aggr&lt;/B&gt;(&lt;B&gt;if&lt;/B&gt;(&lt;B&gt;EmpStatus&lt;/B&gt;= 'Active', &lt;B&gt;if&lt;/B&gt;(&lt;B&gt;Month&lt;/B&gt; = &lt;B&gt;ScorecardMonth&lt;/B&gt;, &lt;B&gt;[Employee NO]&lt;/B&gt;)),&lt;B&gt;[Employee NO]&lt;/B&gt;))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;But this only gives me 718?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;7895 is the right answer, where i am i going wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jun 2010 17:15:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/AGGR-vs-SET-ANALYSIS-why-do-my-numbers-differ/m-p/264122#M1205650</guid>
      <dc:creator />
      <dc:date>2010-06-29T17:15:31Z</dc:date>
    </item>
    <item>
      <title>AGGR vs SET ANALYSIS why do my numbers differ</title>
      <link>https://community.qlik.com/t5/QlikView/AGGR-vs-SET-ANALYSIS-why-do-my-numbers-differ/m-p/264123#M1205651</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;in the example above ScorecardMonth = 'May 2010'&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jun 2010 19:58:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/AGGR-vs-SET-ANALYSIS-why-do-my-numbers-differ/m-p/264123#M1205651</guid>
      <dc:creator />
      <dc:date>2010-06-29T19:58:12Z</dc:date>
    </item>
    <item>
      <title>AGGR vs SET ANALYSIS why do my numbers differ</title>
      <link>https://community.qlik.com/t5/QlikView/AGGR-vs-SET-ANALYSIS-why-do-my-numbers-differ/m-p/264124#M1205652</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am probably missing something, but why are you trying to use the AGGR function&amp;gt; why wouldn't you just have:&lt;/P&gt;&lt;P&gt;count(if(EmpStatus= 'Active', if(Month = ScorecardMonth, [Employee NO])))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jun 2010 20:09:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/AGGR-vs-SET-ANALYSIS-why-do-my-numbers-differ/m-p/264124#M1205652</guid>
      <dc:creator>sicilianif</dc:creator>
      <dc:date>2010-06-29T20:09:34Z</dc:date>
    </item>
    <item>
      <title>AGGR vs SET ANALYSIS why do my numbers differ</title>
      <link>https://community.qlik.com/t5/QlikView/AGGR-vs-SET-ANALYSIS-why-do-my-numbers-differ/m-p/264125#M1205653</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks. You're not missing anything, i think it's me overcomplicating things! .... I've used your amendment above and it works a treat!&lt;/P&gt;&lt;P&gt;Any guidance on when you need to use the AGGR function and when not to?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jun 2010 20:32:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/AGGR-vs-SET-ANALYSIS-why-do-my-numbers-differ/m-p/264125#M1205653</guid>
      <dc:creator />
      <dc:date>2010-06-29T20:32:13Z</dc:date>
    </item>
    <item>
      <title>AGGR vs SET ANALYSIS why do my numbers differ</title>
      <link>https://community.qlik.com/t5/QlikView/AGGR-vs-SET-ANALYSIS-why-do-my-numbers-differ/m-p/264126#M1205654</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You use the aggr() function when you basically need a temporary table to compute something. Like lets say you have a bunch of sales by customer. Let's say you want to know the most recent first sale to any customer. Let's say customer A bought something in January, February and March, customer B bought something in February, March and May, and customer C bought something in March, April and May. The earliest each customer bought anything is A=January, B=February, C=March. So you want to return March. March isn't the maximum month, and it's not the minimum month. It's a combination, and you ned to build a temporary table to get there. Aggr() is what lets you do that. In this case:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;max(aggr(min(SalesMonth),Customer))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jun 2010 00:20:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/AGGR-vs-SET-ANALYSIS-why-do-my-numbers-differ/m-p/264126#M1205654</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2010-06-30T00:20:11Z</dc:date>
    </item>
  </channel>
</rss>

