Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

error messages during loading data

Hello,

How to manage and avoid error messages during loading data when the process doesn't  find a field?

I need that the data loading process take no notice of empty fields and continues uploading.

Thank u in advance.

Tags (2)
4 Replies

Re: error messages during loading data

Set the ErrorMode to 0. Add this line to your script before the first load statement:

SET ErrorMode = 0;


The load will fail if a field doesn't exist, but the script will continue to execute. If you don't care which fields get loaded then use the start *:

LOAD * FROM somewhere;


talk is cheap, supply exceeds demand
Not applicable

Re: error messages during loading data

hI,

thank you Gysbert for your help but when I add SET ErrorMode = 0; the script doesn't give me error, it is true but it load anything.My objective is to load the fields that exist.

For exemple in the script I load "Nation", "capital" and "Address", and if the system doesn't find "Nation" in my file, I want to load capital and address.

There are a solution for this?

Not applicable

Re: error messages during loading data

hI,

thank you Gysbert for your help but when I add SET ErrorMode = 0; the script doesn't give me error, it is true but it load anything.My objective is to load the fields that exist.

For exemple in the script I load "Nation", "capital" and "Address", and if the system doesn't find "Nation" in my file, I want to load capital and address.

There are a solution for this?

Siva_Sankar
Honored Contributor

Re: error messages during loading data

You can use the FieldNumber function to determine whether a field exists in a table. For example FieldNumber('MyField', 'MyTable') returns the position of MyField within MyTable.

If MyField does not exist in MyTable the function returns zero. You can adapt this to your advantage by loading all fields from your QVD into a temporary table and then checking to see if this table contains the field. If it does, you can continue loading. If not, you can simply set the field to zero.

Also, refer https://community.qlik.com/thread/77185

Community Browser