Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
danielnevitt
Creator
Creator

CountIf help

Hi,

I have the following expression and I would really appreciate some help.

=Count({<extended_amt={'>=$(vInputAmount)'}>}extended_amt)

Is it possible to only show results where the result of the count is greater than or equal to 2?

Thanks,

Daniel

1 Solution

Accepted Solutions
sunny_talwar

May be this:

If(Count({<extended_amt = {'>=$(vInputAmount)'}>} extended_amt) >=2, Count({<extended_amt ={'>=$(vInputAmount)'}>} extended_amt))

View solution in original post

9 Replies
sunny_talwar

May be this:

If(Count({<extended_amt = {'>=$(vInputAmount)'}>} extended_amt) >=2, Count({<extended_amt ={'>=$(vInputAmount)'}>} extended_amt))

Anonymous
Not applicable

is this?

=if(Count({<extended_amt={'>=$(vInputAmount)'}>}extended_amt)>=2, Count({<extended_amt={'>=$(vInputAmount)'}>}extended_amt))

danielnevitt
Creator
Creator
Author

Thank you, that works perfectly.

Regards,

Daniel


Kushal_Chawda

Yes, you can do it

if( Count({<extended_amt={'>=$(vInputAmount)'}>}extended_amt)>=2,

Count({<extended_amt={'>=$(vInputAmount)'}>}extended_amt),0)

sunny_talwar

Awesome

danielnevitt
Creator
Creator
Author

Thanks for the above responses.

Unfortunately when validating my data, I noticed that it returns incorrect values for the count.

Even if I enter Count(extended_amt the values returned are incorrect.  ie it returns two when there is only one item matching this value.  Is there something I am doing wrong?

Regards,

Daniel

Anonymous
Not applicable

didnt understand your requirement what exactly you want but try Distinct:

=if(Count({<extended_amt={'>=$(vInputAmount)'}>} extended_amt)>=2, Count({<extended_amt={'>=$(vInputAmount)'}>} distinct  extended_amt))

sunny_talwar

Yes, I agree with Balraj, amy be you need this:

If(Count(DISTINCT {<extended_amt = {'>=$(vInputAmount)'}>} extended_amt) >=2, Count(DISTINCT {<extended_amt ={'>=$(vInputAmount)'}>} extended_amt))

syukyo_zhu
Creator III
Creator III

Can you upload your application Qvw?