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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to allocate a default value if the data is missing

Hi,

a bit of coding help required. I have two spreadsheets from two different sources. In one of the spreadsheets that I am loading, it does not hold data for the country (wierd I know).

what I want to do is assign a text value during the load process that will identify that the data is missing. Add in the word 'Missing'.

I have tried the IsNull but I don't think the source field is being recognised as a null, just a Blank or empty string.

How do I code around this?

All replies gratefully recieved.

Jim


4 Replies
PrashantSangle

Hi,

Try

if(len(Trim(fieldName))<1,'Missing',fieldName)

Or

if(Isnull(fieldName),'Missing',FieldName)

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
alexandros17
Partner - Champion III
Partner - Champion III

Load

     ...

     if(isnull(Country) or Trim(Country)='', 'Missing', Country) as Country

     ...

Resident myTable;

Let me know

Not applicable
Author

Thank you - worked a treat

Not applicable
Author

Thanks Alessandro - very helpful