Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

nhbethea
New Contributor III

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
nhbethea
New Contributor III

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

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

5 Replies
MVP
MVP

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

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.

nhbethea
New Contributor III

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

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

nhbethea
New Contributor III

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

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.

MVP
MVP

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

Could you post a small sample app?

nhbethea
New Contributor III

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

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

Community Browser