Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I'm trying a if statement with IsNull, and it does not seem to give med the correct output. I have tried the same statement as a expression after Load and it works perfect. Any Ideas how to get it working inside the script load?
My output becomes
Treatment Exists on all 'Treatment Exists' which is correct, but shows a null on 'No Treatments' i use this in the scrip load
if(IsNull(Treatment_ID),'No Treatment','Treatment exists') as Status
Thanks Theo
Try,
if(Len(Trim(Treatment_ID))=0,'No Treatment','Treatment exists') as Status
Try,
if(Len(Trim(Treatment_ID))=0,'No Treatment','Treatment exists') as Status
Hi,
you can try:
if(IsNull(Treatment_ID) or Len(Trim(Treatment_ID))=0,'No Treatment','Treatment exists') as Status
Hi, sorry did not work because Treatment_ID that does not exist is not set to 0 its blank - thanks anyway
Hi, sorry did not work because Treatment_ID that does not exist is not set to 0 its blank - thanks anyway
Did you really try the expression suggested above? It is not really checking for it's value (to be 0) but it's length. Nulls are often confusing because there would be values with zero length or spaces which are not nulls. You can capture all these cases (including real nulls) with the above expression. If that is not working, try to share a sample qvw that demonstrates the issue.
Try in the edit
Set NULLINTERPRET ='';
After that your if condition