<?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: Count(if(aggr)) counts only the first value. Why? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Count-if-aggr-counts-only-the-first-value-Why/m-p/769321#M472698</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually, in my case, adding nodistinct to aggr in initial expression solved the problem. So it became&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14192616342336520" jivemacro_uid="_14192616342336520"&gt;&lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;Count(if(aggr(nodistinct min(TDATE),CID)&amp;gt;EDATE, EID))&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;But the real data model appears to be much more complicated and the trick doesn't work well. So I'll try to adapt it to my solution. If fail, I'll come back for more assistance. Anyway, thank you, guys!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 22 Dec 2014 15:27:47 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-12-22T15:27:47Z</dc:date>
    <item>
      <title>Count(if(aggr)) counts only the first value. Why?</title>
      <link>https://community.qlik.com/t5/QlikView/Count-if-aggr-counts-only-the-first-value-Why/m-p/769318#M472695</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've got 2 tables:&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14190405945427170" jivemacro_uid="_14190405945427170"&gt;
&lt;P&gt;t1:&lt;/P&gt;
&lt;P&gt;Load CID,TID,date(Tdate,'DD.MM.YYYY')as TDATE Inline&lt;/P&gt;
&lt;P&gt;[&lt;/P&gt;
&lt;P&gt;&amp;nbsp; CID,TID,Tdate&lt;/P&gt;
&lt;P&gt;&amp;nbsp; 1,1,25.12.2014&lt;/P&gt;
&lt;P&gt;&amp;nbsp; 1,2,20.05.2014&lt;/P&gt;
&lt;P&gt;&amp;nbsp; 2,3,14.03.2015&lt;/P&gt;
&lt;P&gt;&amp;nbsp; 1,4,28.10.2015&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;
&lt;P&gt;t2:&lt;/P&gt;
&lt;P&gt;Load CID,EID,date(Edate,'DD.MM.YYYY')as EDATE Inline&lt;/P&gt;
&lt;P&gt;[&lt;/P&gt;
&lt;P&gt;&amp;nbsp; CID,EID,Edate&lt;/P&gt;
&lt;P&gt;&amp;nbsp; 1,9,18.05.2014&lt;/P&gt;
&lt;P&gt;&amp;nbsp; 1,7,16.05.2014&lt;/P&gt;
&lt;P&gt;&amp;nbsp; 1,1,21.05.2014&lt;/P&gt;
&lt;P&gt;&amp;nbsp; 1,2,19.05.2014&lt;/P&gt;
&lt;P&gt;&amp;nbsp; 2,3,20.05.2014&lt;/P&gt;
&lt;P&gt;&amp;nbsp; 1,4,29.11.2015&lt;/P&gt;
&lt;P&gt;&amp;nbsp; 1,5,26.05.2014&lt;/P&gt;
&lt;P&gt;&amp;nbsp; 1,6,15.04.2014&lt;/P&gt;
&lt;P&gt;&amp;nbsp; 1,8,17.06.2014&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;and a straight table chart with a dimension CID and expression &lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14190408359305109" jivemacro_uid="_14190408359305109"&gt;
&lt;P&gt;Count(if(aggr(min(TDATE),CID)&amp;gt;EDATE, EID))&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;The count shows values = 1 for both CIDs, inspite that there are several (4) EIDs for CID=1 that suit the condition. I found out that the Count finds only the first suitable EDATE in the table, but for all others the condition is false. What's wrong?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Dec 2014 02:06:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-if-aggr-counts-only-the-first-value-Why/m-p/769318#M472695</guid>
      <dc:creator />
      <dc:date>2014-12-20T02:06:03Z</dc:date>
    </item>
    <item>
      <title>Re: Count(if(aggr)) counts only the first value. Why?</title>
      <link>https://community.qlik.com/t5/QlikView/Count-if-aggr-counts-only-the-first-value-Why/m-p/769319#M472696</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Count(If(Aggr(NODISTINCT Min(TDATE),CID)&amp;gt;Aggr(Only(EDATE),CID,EID),EID))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Dec 2014 08:47:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-if-aggr-counts-only-the-first-value-Why/m-p/769319#M472696</guid>
      <dc:creator>vivek_niti</dc:creator>
      <dc:date>2014-12-20T08:47:42Z</dc:date>
    </item>
    <item>
      <title>Re: Count(if(aggr)) counts only the first value. Why?</title>
      <link>https://community.qlik.com/t5/QlikView/Count-if-aggr-counts-only-the-first-value-Why/m-p/769320#M472697</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;=SUM(IF(Date(Aggr(Only(EDATE),EID,CID)) &amp;lt;=Aggr(NODISTINCT Min(TDATE),CID),1,0))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Dec 2014 11:17:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-if-aggr-counts-only-the-first-value-Why/m-p/769320#M472697</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2014-12-20T11:17:24Z</dc:date>
    </item>
    <item>
      <title>Re: Count(if(aggr)) counts only the first value. Why?</title>
      <link>https://community.qlik.com/t5/QlikView/Count-if-aggr-counts-only-the-first-value-Why/m-p/769321#M472698</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually, in my case, adding nodistinct to aggr in initial expression solved the problem. So it became&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14192616342336520" jivemacro_uid="_14192616342336520"&gt;&lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;Count(if(aggr(nodistinct min(TDATE),CID)&amp;gt;EDATE, EID))&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;But the real data model appears to be much more complicated and the trick doesn't work well. So I'll try to adapt it to my solution. If fail, I'll come back for more assistance. Anyway, thank you, guys!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Dec 2014 15:27:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-if-aggr-counts-only-the-first-value-Why/m-p/769321#M472698</guid>
      <dc:creator />
      <dc:date>2014-12-22T15:27:47Z</dc:date>
    </item>
  </channel>
</rss>

