3 Replies Latest reply: Dec 22, 2014 10:27 AM by Александр Закревский RSS

    Count(if(aggr)) counts only the first value. Why?

    Александр Закревский

      I've got 2 tables:

      t1:
      Load CID,TID,date(Tdate,'DD.MM.YYYY')as TDATE Inline
      [
        CID,TID,Tdate
        1,1,25.12.2014
        1,2,20.05.2014
        2,3,14.03.2015
        1,4,28.10.2015
      ];
      t2:
      Load CID,EID,date(Edate,'DD.MM.YYYY')as EDATE Inline
      [
        CID,EID,Edate
        1,9,18.05.2014
        1,7,16.05.2014
        1,1,21.05.2014
        1,2,19.05.2014
        2,3,20.05.2014
        1,4,29.11.2015
        1,5,26.05.2014
        1,6,15.04.2014
        1,8,17.06.2014
      ];
      

      and a straight table chart with a dimension CID and expression

      Count(if(aggr(min(TDATE),CID)>EDATE, EID))
      

      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?