Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Replacing Blank field with 'NA'

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

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

If(IsNull(ClaimOwner) or Len(Trim(ClaimOwner)) = 0, 'N/A', ClaimOwner) as ClaimOwner

View solution in original post

5 Replies
Not applicable
Author

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,

Not applicable
Author

Also, you can check for the Null or empty values while loading the data in the Load script.

MK_QSL
MVP
MVP

If(IsNull(ClaimOwner) or Len(Trim(ClaimOwner)) = 0, 'N/A', ClaimOwner) as ClaimOwner

sunny_talwar

Try this:

If(Len(Trim(ClaimOwner)) = 0, 'NA', ClaimOwner) as ClaimOwner2.1

HTH

Best,

Sunny

maxgro
MVP
MVP

isnull() is for null

len(trim()) is for blank