Skip to main content
Announcements
Qlik Community Office Hours - Bring your Ideation questions- May 15th, 11 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
evansabres
Specialist
Specialist

Occasional missing field

I have a field within my data source, called 'Lifetime Post Consumptions by type - video play. This field represents video content that is watched. If during a given week, there were no videos watched, the field is omitted from the data offload by the data source.

This causes an error in my script. Can I do anything in the script to essentially if this field is non-existent, skip without corrupting the rest of the load?

2 Replies
jaumecf23
Creator III
Creator III

Hi,

You can do something like this:

MyTable:

LOAD

*

from Source

;

LET vFieldNo = NoOfFields('MyTable');


if(vFieldNo = x) then


'load all the fields'


else 'load all the fields less the video one'.


The variable vFieldNo returns the number of columns.

evansabres
Specialist
Specialist
Author

It turns out that field was non-essential to my script after all. I needed to pare down what I was attempting to load in instead of just everything. Thank you for this though, I will try using it to see if it will work in the event I come across a similar situation.