Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Handling Nulls and Blank fields

Hi All,

I am loading data form excel. My field as blanks. So when I do if(isnull(trim((Field)),'Y',"N"), I get N for blanks. I checked on the length, it is returning 4 for blanks. Further more, when I show it in table box, it shows blanks as NULL.

Now when I write if(Field='NULL','Y','N') I get Y for blanks.

I am not able to understand as to why this is happening. I know it has to do with the spaces coming form the excel but I am not able to fix it other than writing Field='NULL'

5 Replies
adamdavi3s
Master
Master

Can you share your excel sheet, or a sample of it?

Sounds like there might be some unprintables in there

try len(keep(field,'abcdefghijklmnopqrstuvqxyz012345679')) and see what that gives you

vinieme12
Champion III
Champion III

try

IF(len(Trim(Field))=0,'Blank','NotBlank')

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Anonymous
Not applicable
Author

Hi,

If you do not want any blank records Set Verbatim=1 in script

But if you want as No & Yes than if(len(Trim(Field))=0.'Y','N')

Thanks

Paridhi

Anonymous
Not applicable
Author

when I use len(keepchar(field,'abcdefghijklmnopqrstuvqxyz012345679')) it returns 0 for Nulls or blanks.

Anonymous
Not applicable
Author

So I will have write if (len(keepchar(field,'abcdefghijklmnopqrstuvqxyz012345679'))=0,'NA', field).