Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Comparing field value to NULL in set analysis

I need to have a chart where expression should produce a count of field A when field B is  NULL and second count when field B  is not NULL.

Something like this but with correct syntax.

=count({$<=NULL>}) - this does not work

Is there any other way to implement such logic?

Thank you

9 Replies
danielrozental
Master II
Master II

No, there is no way to select null values.

You could try something like this count(if(isnull(B),A))

Not applicable
Author

What if I replae NULLs with soething else during the load - lets say with string "xyz". can I use

=count({$<="xyz">}) ?

danielrozental
Master II
Master II

Yes, but the correct expression would be

=count({$<={'xyz'}>})


Not applicable
Author

Try...

= Count ({$ < = {$(=null())}>} )  //  Null

= Count ({$ < -= {$(=null())}>} )  //  Not null

Not applicable
Author

ehilsinger - it does not work for me, did it work for you?

erichshiino
Partner - Master
Partner - Master

Hi,

You can write something like this:

count({1-<={*}>})

Explanation:

count({<={*}>}) -> this will count A where B has any value (can be a blank but not a null)

count({1-<={*}>}) -> the '1-' tells that you want to see everything (1) excluding cases where B has value

Hope this helps,

Erich

Not applicable
Author

counts A when B is null

=count({$<={"=isnull(B)"}>})

counts A when B is not null

=count({$<={"*"}>})


raajeshn
Partner - Creator
Partner - Creator

Hi Erich,

I also had a similar problem and your solution worked for me. Thanks a lot.

Regards,

Raajesh N

qliksus
Specialist II
Specialist II

Hi u can try something like

count({$<={"=NULLCOUNT()>0"}>}) +

count({$<={"=NULLCOUNT()=0"}>})