Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Add alternate state to set analysis

What is the correct syntax if I add an alternate state to this set analysis statement?

=count(distinct if(isnull([Gender]), [Participant_ID]))

I need to count the number of times a participant ID has an associated gender type that is null. I need to do this for state 1 and state 2, which represent different time periods.

I haven't had luck slipping in alternate state in. Your help would be appreciated.

Thank you.

4 Replies
Not applicable
Author

...one correction...I need to count the UNIQUE number of times a participant ID has an associated gender type that is null. Need for two different states.

swuehl
MVP
MVP

I don't see a set analyis expression in your current statement, but you can add it like this:

=count({State1} distinct if(isnull([Gender]), [Participant_ID]))


=count({State2} distinct if(isnull([Gender]), [Participant_ID]))

sunny_talwar

Try this maybe:


=Count({[State 1]} + {[State2]} DISTINCT if(isnull([Gender]), [Participant_ID]))

Not applicable
Author

This works! Thank you.

Two additional questions...

I have a table where I'm showing the distinct count of participant IDs for Male, Female and null. I included a multi-box filter where the end user can select if they want to see participant ID counts for just males, just females or just nulls. Null doesn't show up as an option, obviously. Any suggestions on how to get around this? I'd like the end user to only see nulls if they so choose.

Furthermore, if the end user wants to filter on only males, for example, then the participant ID counts for female and null should go to zero. This is happening for female but not null. Is there a way to get around this?

Thank you for the additional help.