Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Suppress error message at script runtime

I have a list of fields that I want to get dropped from the tables that get loaded in a loop.

FOR each tablename in $(varTableNames)

LOAD * ; select * from $(tablename);

DROP Fields $(varFieldNames);

NEXT;

The varFieldNames is a comma separated list of some random fields in the form of 'Table1.field1','Table2.field5' etc.. Now e.g. if the tablename is not the Table1 I get a pop-up with the error message "wrong field name in the drop fields statement" or something for the Table1.field1. It breaks the script execution.

Is there a way to suppress that behavior? I just want to ignore the those errors and let the script run through.

1 Solution

Accepted Solutions
vidyut
Partner - Creator II
Partner - Creator II

put Set ErrorMode=0; before the loop. That should suppress the errors.

View solution in original post

3 Replies
vidyut
Partner - Creator II
Partner - Creator II

put Set ErrorMode=0; before the loop. That should suppress the errors.

Not applicable
Author

Check out

Error Variables

  in the help file to supress the errors

Not applicable
Author

Thanks for the answers they both were helpful. What I had to do on top is just to up the "drop field" statement into a loop. Because otherwise the "drop fields" would not drop any field if at least one could not be found.