Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All
Simple question i bet but i am drawing a blank today.
I have some data which has a number of blank fields (not null) and i want to replace the blank with a 'NA'.
I am using the following formula in my script but it doesn't seem to be working as the blanks are still appearing.
if(IsNull(ClaimOwner),'NA',ClaimOwner) as ClaimOwner2.1,
Any help would be great
Cheers
Andrew
If(IsNull(ClaimOwner) or Len(Trim(ClaimOwner)) = 0, 'N/A', ClaimOwner) as ClaimOwner
You are checking only for the NULL. Probably you should be checking for the empty string as well like
if(IsNull(ClaimOwner) or ClaimOwner='','NA',ClaimOwner) as ClaimOwner2.1,
Also, you can check for the Null or empty values while loading the data in the Load script.
If(IsNull(ClaimOwner) or Len(Trim(ClaimOwner)) = 0, 'N/A', ClaimOwner) as ClaimOwner
Try this:
If(Len(Trim(ClaimOwner)) = 0, 'NA', ClaimOwner) as ClaimOwner2.1
HTH
Best,
Sunny
isnull() is for null
len(trim()) is for blank