Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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)
You may use something like this:
sign(len(trim(cu.result))) as NullFlag
and then within the expression:
count({< NullFlag = {0}>} id)
- Marcus
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)
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))
You may use something like this:
sign(len(trim(cu.result))) as NullFlag
and then within the expression:
count({< NullFlag = {0}>} id)
- Marcus
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)
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))
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❤️