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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Column 'ColumnName' cannot be null error: though schema set to accept

Hello,
I can't seem to get rid of NULLs appearing in my job (and stopping the mapping due to the above error)
At first I had "Nullable" unchecked, so I can understand the error...
Then I checked Nullable and also gave my fields default values as well (then removed the default values)
Still when I run the job I get the Column 'ColumnName' cannot be null
Ideally I'd like to actually make them not null, but place a default value in them as part of the ETL
Thank You 0683p000009MACn.png
Labels (2)
10 Replies
Anonymous
Not applicable
Author

Hi,
Could you please elaborate your case with an example with input and expected output values? flow?
Usually, you can transform the data on tMap component, If there are some values And null values(Empty) in your input source.
Write the expression on the output table of tMap like:
row1.columnName==null||row1.columnName.equals("")?"default":row1.columnName
Check the nullable box of the column on the schema if you want to compare the object is null or not.
The expression should be: row1.columnName==null?null:row1.columnName
Best regards
Sabrina
Anonymous
Not applicable
Author

Thanks ok
Anonymous
Not applicable
Author

Hi,
How is the column defined in your database schema? Does it allow null values? Not sure if you checked this already but wanted to mention it - I just had a similar scenario.
Tom
Anonymous
Not applicable
Author

Hi, ddctf
Is your job working? Feel free post your issue on forum.
Best regards
Sabrina
Anonymous
Not applicable
Author

Hi, thanks I seem to have gotten past this error, can mark as resolved
Anonymous
Not applicable
Author

Hi,
Thanks for your feedback.
Best regards
Sabrina
_AnonymousUser
Specialist III
Specialist III

Hi!
I have a simlar problem with Null values. In my case I need to concatenate two fileds, Christan Name and Last Name. The null values do not disapper in my output file. The filed Efternamn (last name) sometime is empty and cases the null values.
row1.FOERNAMN+" "+(row1.EFTERNAMN ==null?null:row1.EFTERNAMN)
What might be wrong in my formula.
BR
Krister
Anonymous
Not applicable
Author

Hi Krister,
Your input is empty and not null. So, check for the length of input for that column and set empty if true else set actual.
row1.FOERNAMN+" "+(StringHandling.LEN(row1.EFTERNAMN) < 1?"":row1.EFTERNAMN)
Thanks
Vaibhav
Anonymous
Not applicable
Author

Thanks this was likely my error too