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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Conditional Counting

Hello,

I have a question (probably super simple for most of you)...

I need to create an expression where I am able to distinctly count records in column 1 if the records in column 2 are greater than zero. Here's an example that has no particular relevance:

Group                    Cost

A                              $1.21

B                              $3.16                             

C                              $0.92

D                              $0.00

E                              $10.22             

F                              $0.00

The answer would be 4 because I would count A, B, C, and E since they are all greater than $0.00.

How do I do this?

Thanks in advance:)

3 Replies
mikecrengland
Creator III
Creator III

Try something like:

Count({<Cost = {">0"}>} Distinct Group)

mike

MK_QSL
MVP
MVP

=COUNT({<Cost = {">0"}>}DISTINCT Group)

or

=Count({<Group = {"=SUM(Cost)>0"}>}DISTINCT Group)

Not applicable
Author

Thank you Mike!