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

NullAsValue replaces null values on one Field, but not the other

For example

I have a field with null values that I want to replace with a string. When referencing a field from Table A, the script works as expected and replaces all null values in 'MyWorkingField' on Table A. However, I realized "MyWorkingField" from Table A will not work. Instead I need to use "MyBrokenField" from Table B, however when replacing "MyWorkingField" with "MyBrokenField" the script does not work.

Set NullValue="Hello";

NullAsValue MyWorkingField;           // this is from Table A and works as expected

Set NullValue="Hello";

NullAsValue MyBrokenField;             // this is from Table B and does not work.

Initially I put this script at the bottom of the "Main" sheet in the Data Load Editor and it worked fine with 'MyWorkingField', this did not work for "MyBrokenField". I have tried putting the same script for "MyBrokenField" in the Auto-Generated section under the corresponding table only to get the same result.

Any help would be greatly appreciated as I have poured over the forums to find an answer and this is really frustrating.

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

We were able to find a work-around. Thank you for your help regardless.

View solution in original post

5 Replies
swuehl
MVP
MVP

Have a look at the HELP:

The NullAsValue statement operates as a switch and will operate on subsequent loading statements


If I understand correctly, you made the statement after loading the table. Put it on top of the table load.

Anonymous
Not applicable
Author

Thank you for the quick response. I will test and update the post tomorrow when I'm back on-site

Anonymous
Not applicable
Author

There was no change when moving it before the table load.

Let me know if this could be causing the error:

For example, I have two tables that both have the field 'MyBrokenField' so they are loaded in as Table1.MyBrokenField and Table2.MyBrokenField automatically.

The MyWorkingField is a unique string and not used in any other tables. Could the error be caused by the fields having the same name? And if so, is there a work-around for this?

I have tried using [Table1.MyBrokenField] as well as just MyBrokenField with no luck.

swuehl
MVP
MVP

Could you post a small sample app?

Anonymous
Not applicable
Author

We were able to find a work-around. Thank you for your help regardless.