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: 
danielnevitt
Creator
Creator

Count where field contains Y

Hi,

I have a field named CompanyGEnUK that contains either Y or N.  I am struggling to create an expression that:

1) counts when CompanyGEnUK = Y

2) only shows the results where CompanyGEnUK includes Y

In point 2, the data may have 10 result of which 5 contain CompanyGEnUK = Y.  I would like to show these results and exclude any where all the CompanyGEnUK = N

Thanks for your help.

Regards,
Daniel

 

1 Solution

Accepted Solutions
Anil_Babu_Samineni

Don't include red part in other expressions IF u don't need

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful

View solution in original post

5 Replies
Anil_Babu_Samineni

You mean like this

Count({<CompanyGEnUK = {'Y'}>} CompanyGEnUK)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
danielnevitt
Creator
Creator
Author

Thank you for the quick reply.

Is there a way to only show records where the count is greater than 0?

Regards,
Daniel

Anil_Babu_Samineni

Perhaps this

Count({<CompanyGEnUK = {'Y', "=Count({<CompanyGEnUK = {'Y'}>} CompanyGEnUK)>0"}>} CompanyGEnUK)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
danielnevitt
Creator
Creator
Author

Thanks that works to show the count.  However as I have multiple other expressions, it shows all of the results including where the above field equals 0.

Regards,
Daniel

Anil_Babu_Samineni

Don't include red part in other expressions IF u don't need

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful