Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Loading a field that isn't always there

I am loading XML files that provide a series of fields only if there is data within them. See example below. I cannot load *, otherwise I would do that first and then transform the resident table. Is there a way for me to check to see if a field is there before loading the file?

Monday's Extract (three fields):

OrderIDAmountLocation
110Mexico
24Canada
35

England

Tuesday's Extract (four fields):  

OrderIDAmountLocationState
110Mexico
24Canada
35England
41USANY

Thanks in advance!

2 Replies
MVP
MVP

Re: Loading a field that isn't always there

ScriptError = 11 denotes 'Field Not Found'. Hence try like:

set ErrorMode=0;

load Field1 from <>;

      if ScriptError=11 then

           Set vError= 'FieldNotFound';

      End If      

MVP & Luminary
MVP & Luminary

Re: Loading a field that isn't always there

Can you post a sample xml file?

- Ralf