<?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 Problem with Aggr() function in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Problem-with-Aggr-function/m-p/315367#M116385</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've 3 dimensions(i.e as shown in below image) and 1 exp as =Count(Aggr(Sum(Lenskey),DefectName)).&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image" src="https://community.qlik.com/legacyfs/online/8583_Capture.PNG" /&gt;&lt;/P&gt;&lt;P&gt;- In defecname colomn you can see different string names. Now, I want to display in the expression as per count of defectname values&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For eg:&lt;/P&gt;&lt;P&gt;In the above table you can see in DefectName column two Defect.Edge values so i want plot in the expression part as 2 for dat particular value Defect.Edge whereever i see. Right now the above tables has Defect.Edge value for Lenskey 1001. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Same for Debris,FM,Bubble as per there own count.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 12 Nov 2011 04:07:37 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-11-12T04:07:37Z</dc:date>
    <item>
      <title>Problem with Aggr() function</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-Aggr-function/m-p/315367#M116385</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've 3 dimensions(i.e as shown in below image) and 1 exp as =Count(Aggr(Sum(Lenskey),DefectName)).&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image" src="https://community.qlik.com/legacyfs/online/8583_Capture.PNG" /&gt;&lt;/P&gt;&lt;P&gt;- In defecname colomn you can see different string names. Now, I want to display in the expression as per count of defectname values&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For eg:&lt;/P&gt;&lt;P&gt;In the above table you can see in DefectName column two Defect.Edge values so i want plot in the expression part as 2 for dat particular value Defect.Edge whereever i see. Right now the above tables has Defect.Edge value for Lenskey 1001. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Same for Debris,FM,Bubble as per there own count.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 Nov 2011 04:07:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-Aggr-function/m-p/315367#M116385</guid>
      <dc:creator />
      <dc:date>2011-11-12T04:07:37Z</dc:date>
    </item>
    <item>
      <title>Problem with Aggr() function</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-Aggr-function/m-p/315368#M116386</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jacq,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not 100% if I got your requirement correctly, but I think the expression could look like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=count(total&amp;lt;DefectName&amp;gt; Lenskey)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your above statement has two issues in my opinion:&lt;/P&gt;&lt;P&gt;- First, you probably need a NODISTINCT qualifier to get results for multiple occurences of your DefectName Values, that's why some rows show zeros. So try a&lt;/P&gt;&lt;P&gt;=count(aggr( NODISTINCT sum(Lenskey), DefectName))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This should show you 1 for all rows. But why 1's?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- This is due to the fact that you first sum the Lenskey values per DefectName, resulting in e.g. 2002 for Edge, counting that value in your outer aggregation is always 1 (Note that DefectName is limited to chart dimensions), you only get one DefectName on that aggregation level.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To get around this, you probably could use&lt;/P&gt;&lt;P&gt;=sum( aggr( NODISTINCT count(Lenskey), DefectName))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so first count the Keys per DefectName, then sum. But this is more complex than my above initial suggestion and the total rows will be different.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But it always depend what you want to achieve, and this I haven't understood completely.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 Nov 2011 11:57:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-Aggr-function/m-p/315368#M116386</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-11-12T11:57:02Z</dc:date>
    </item>
    <item>
      <title>Problem with Aggr() function</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-Aggr-function/m-p/315369#M116387</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot swuehl i'll work out and get back to u&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 Nov 2011 14:14:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-Aggr-function/m-p/315369#M116387</guid>
      <dc:creator />
      <dc:date>2011-11-12T14:14:45Z</dc:date>
    </item>
  </channel>
</rss>

