Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
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
tresesco
MVP
MVP

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

set ErrorMode=0;

load Field1 from <>;

      if ScriptError=11 then

           Set vError= 'FieldNotFound';

      End If      

rbecher
MVP
MVP

Can you post a sample xml file?

- Ralf

Astrato.io Head of R&D