Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.

How and in which order executed QV a load-statement?

Hello,

how and in which order executed QV a load-statement?

Background is to check within a load-statement if a certain field exists and if not load a dummy-value or another field. But a check like:

Load

....

if(year < 2014, 'n.n.', [Field X]) as [Field X],

....

From path/file*.txt

within a load returned a load-error (field not found) if [Field X] don't exists. This don't failed only by internal field-checks but also by file-functions like:

if(makedate(mid(filebasename(), 11, 4), mid(filebasename(), 16, 2), 1) < '01.01.2014', 'n.n.', [Field X]) as [Field X],

Is there any possibility to solve this within a load-statement and avoiding several loads or loops around the load to create a variable load-statement?

Many thanks, Marcus.

Tags (2)
2 Replies
MVP
MVP

Re: How and in which order executed QV a load-statement?

Could setting ErrorMode be an option ? Like:

Set ErrorMode=0;

Load AA from <>;

If ScriptError=11 then           // 11 - Field not found

     Load

          BB as XField

     From <>;

Else

     Load

          AA as XField

     From <>;

End If

Re: How and in which order executed QV a load-statement?

Thanks for your reply tresesco. It's an interesting idea but it avoid only the script-error and don't load all my files. I have it also tested with resident and preceding load but it's all the same.

Interesting would be how the load worked from a technical point of view - perhaps Henric Cronström could give some information?

- Marcus

Community Browser