3 Replies Latest reply: Oct 26, 2015 12:46 PM by Stefan Wühl RSS

    Count greater than

      Hi I have this expression which works fine for the table below:

       

      count({$<ClientId={"$(vClientId)"}>}Aggr(count(DISTINCT AssignedAgent),assignwarehouse.LeadId))

       

      ClientID     assignwarehouse.LeadId     AssignedAgent

      ABC          123                                   1

      ABC          123                                   2

      ABC          777                                   4                                  

      ABC          777                                   5

      ABC          777                                   1

       

       

      I want to put a filter where count(AssignedAgent)>2 .

       

      I tried this without luck:

       

      COUNT({$<ClientId={"$(vClientId)"},Aggr(count(DISTINCT AssignedAgent),assignwarehouse.LeadId)={">2"}>}Aggr(count(DISTINCT AssignedAgent),assignwarehouse.LeadId))

       

      Please help !

        • Re: Count greater than
          Stefan Wühl

          No, this won't work, only field names (no expressions) allowed on left side of the set modifier's equal sign.

           

          You seem to have another dimension in your table, can you tell which one? Is this a primary key field in the context of your table, then you can write something like

           

           

          COUNT({$<ClientId={"$(vClientId)"}, YourField = {"=Count(AssignedAgent)>2"} >}Aggr(count(DISTINCT AssignedAgent),assignwarehouse.LeadId))


          Maybe this field is assignwarehouse.LeadId ?

            • Re: Count greater than

              This is my entire table:

               

              ClientID     assignwarehouse.LeadId     AssignedAgent   AssignDate

              ABC          123                                   1                         2015-1-1

              ABC          123                                   2                         2015-1-1

              ABC          777                                   4                         2015-1-1       

              ABC          777                                   5                         2015-1-1

              ABC          777                                   1                         2015-1-1



              So, you mean to say I do a count of AssignDate in the filter? Instead of count of the expression?


              Sorry, I'm new to Qlik so my understanding is not that great yet.