Skip to main content
Announcements
Save $600 on Qlik Connect registration! Sign up by Dec. 6 to get an extra $100 off with code CYBERSAVE: REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
neerajthakur
Creator III
Creator III

How can I implement or Include Null values in Set Analysis in Qlik Sense

How can I implement this in Set Analysis? 

(cu.result ='' or cu.result = null) and tc.coursetype !=4

I have created a flag for null but can use it simultaneously for result=''

count({<SA Here>} id)
Thanks & Regards,
Please Accepts as Solution if it solves your query.
Labels (4)
2 Solutions

Accepted Solutions
marcus_sommer

You may use something like this:

sign(len(trim(cu.result))) as NullFlag

and then within the expression:

count({< NullFlag = {0}>} id)

- Marcus

View solution in original post

NitinK7
Specialist
Specialist

Load null as the value during script execution

NullAsValue result;
Set NullValue = 'NULL';

ABC:
Load
id,
If(id=2,Null(),result) as result,
coursetype;
load * Inline [
id, result,coursetype
1,,12
2,,13
2,,4
1,,4
3,bncv,8
4,lkd,7
3,bnn,4

];

and try the below set analysis/expression

=count({< coursetype-={'4'}, result={'' , 'NULL'}>} id)

NitinK7_0-1646222537023.png

or 

you can use the below expression directly without declaring null as a value during script execution

=count({<coursetype-={'4'}>}if(result='' or isnull(result),id))

 

View solution in original post

3 Replies
marcus_sommer

You may use something like this:

sign(len(trim(cu.result))) as NullFlag

and then within the expression:

count({< NullFlag = {0}>} id)

- Marcus

NitinK7
Specialist
Specialist

Load null as the value during script execution

NullAsValue result;
Set NullValue = 'NULL';

ABC:
Load
id,
If(id=2,Null(),result) as result,
coursetype;
load * Inline [
id, result,coursetype
1,,12
2,,13
2,,4
1,,4
3,bncv,8
4,lkd,7
3,bnn,4

];

and try the below set analysis/expression

=count({< coursetype-={'4'}, result={'' , 'NULL'}>} id)

NitinK7_0-1646222537023.png

or 

you can use the below expression directly without declaring null as a value during script execution

=count({<coursetype-={'4'}>}if(result='' or isnull(result),id))

 

neerajthakur
Creator III
Creator III
Author

Thanks, @marcus_sommer @NitinK7 I tried both of your ways and both gave the same results.

Please see to below post if you can help.

How to implement nullif along with the cast and coalesce in QlikSense

 

Regards❤️

Thanks & Regards,
Please Accepts as Solution if it solves your query.