Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
How to check for null values in the script file?
I have a variable.
var1
I need to check whether the value of the variable is null or not.
i tried
IF( $(var1) = Null
then
set Var2 = Blue();
endif
but it is thowing an error.
Regards
Naveenchellaaraam
I think the most robust test is
len('$(v1)') = 0
Note the single quotes around the variable.
-Rob
IsNull(X) returns True if X is null.
Also Len(Trim(X)) = 0 if X is null.
http://community.qlik.com/docs/DOC-3155 has more details.
try below code .
if(isnull($(var1)),Blue())
or
if(len($(var1))=0,Blue())
or
if(($(var1))=' ',Blue())
hope this helps
Try this....
If Len ($(var1)) = 0 then
Set Var2 = 'blue()';
Endif.
I think the most robust test is
len('$(v1)') = 0
Note the single quotes around the variable.
-Rob