Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
priyarane
Specialist
Specialist

Field not found with table load

Hi Community,

Is there any way to load table even if Field not found error, with error modes we can avoid failure but we can't load rest of the load.

for Ex:

table:

load*,if(d='a','te','be') as test_flat

from table;

above table d field is not there but we need to avoid failure as well as need to load other fields. it should be dynamic as I mentioned only one field like 'd', but in real there are couple of tables and couple of fields..

-Priya

11 Replies
marcus_sommer

It's not possible to check the existence of a field within a load-statement. You will always need an additionally outside check if a field exists or not. This could be done by loading only the the first record of a file and then looping through all fields and checking them against your conditions and using this to branch into different load-statements.

By qvd-files is it a bit easier because with the qvd-functions these information could be gathered by reading the qvd-header maybe in this way:

for i = 1 to qvdnooffields('YourQVD')

     let vFieldCheck = match(qvdfieldname('YourQVD', $(i)), 'd');

     if $(vFieldCheck) = true() then

          exit for

     end if

next

if $(vFieldCheck) = true() then

     LoadStatement1

else

     LoadStatement2

end if

Easier then this will be just to use different folders for the different qvd-structures and using then two different load-statements.

- Marcus

Anil_Babu_Samineni

Just to know, Can't we do like this?

for i = 1 to qvdnooffields('YourQVD')

     let vFieldCheck = match(qvdfieldname('YourQVD', $(i)), 'd');

     if $(vFieldCheck) = true() then

          LoadStatement1

     else

         LoadStatement2

     end if

next

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful