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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Count Multiple Conditions

Hello,

This expression is building off one of my previous ones, but I'm making sure that I have the syntax right. The conditions should be:

1. STATUS_TITLE must be one of these: 'Pending Certification', 'Pending Completion', 'Pending Qualification'

2. CERTIFICATION_DATE must be either: ' ' or '0'

If these two are met, then it should count RTC_TITLE.

This is my equation so far:

=Count({$<STATUS_TITLE = {'Pending Certification', 'Pending Completion', 'Pending Qualification'}, CERTIFICATION_DATE = {'', '0'}  >} RTC_TITLE)

It keeps throwing straight 0's though which is not correct.

Any help is appreciated!

Thanks!

Labels (1)
3 Replies
swuehl
Champion III
Champion III

Start testing each filter on its own:

=Count({$<STATUS_TITLE = {'Pending Certification', 'Pending Completion', 'Pending Qualification'} >} RTC_TITLE)

=Count({$<CERTIFICATION_DATE = {'', '0'}  >} RTC_TITLE)

I assume the second is returning zero. Are you sure you want to filter on 0 and on ' '  (is it a single space?)?

Anonymous
Not applicable
Author

Hi Swuehl,

The first filter works with no issues. As you said, the second filter is throwing the errors. Basically I want to count when the STATUS_TITLE is one of those options as well as when the CERTIFICATION_DATE is equal to null or 0. There is a single space in between ' ' currently.

Thanks,

Jordan

swuehl
Champion III
Champion III

Do you have records with CERTIFICATION_DATE equals 0? Then you should see a count >0.

NULL cannot be selected directly. I would suggest replacing NULL with a value in the script.

Depending on your data model and your requirement, maybe something described here may also help:

NULL handling in QlikView