Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
msmichael
Creator
Creator

where exists in load script and field not found

Hi,

I have below script, but when I run it I got "field not found - <F3>" error. I don't know why, hasn't F3 in data2 table already been loaded?? why it still complains F3 not found.. Also, if have to, how should I fix it?

data1:
load * Inline [
F1, F2
1, 'test'
2, 'test2'
3, 'test3'
4, 'test4
];

data2:
load * Inline [
F3, F4
1, 'data2'
2, 'data2test'
];

test:
load
F1, F2
Resident 'data1'
where not Exists(F1, F3);

 

Thanks!

1 Solution

Accepted Solutions
zzyjordan
Creator II
Creator II

Hi, 

Can you try below script?


data1:
load * Inline [
F1, F2
1, 'test'
2, 'test2'
3, 'test3'
4, 'test4
];

data2:
load * Inline [
F3, F4
1, 'data2'
2, 'data2test'
];

NoConcatenate
test:
load
F1 , F2
Resident 'data1'
where not Exists(F3, F1);

Drop Tables data1,data2;

 

Hope this helps

ZZ

View solution in original post

3 Replies
zzyjordan
Creator II
Creator II

Hi, 

Can you try below script?


data1:
load * Inline [
F1, F2
1, 'test'
2, 'test2'
3, 'test3'
4, 'test4
];

data2:
load * Inline [
F3, F4
1, 'data2'
2, 'data2test'
];

NoConcatenate
test:
load
F1 , F2
Resident 'data1'
where not Exists(F3, F1);

Drop Tables data1,data2;

 

Hope this helps

ZZ

msmichael
Creator
Creator
Author

Hi ZZ,

thanks for your reply. yes, basically switching F1 and F3 in the exists function makes the script work.

The error message is a little confusing to me though. because both F1 and F3 fields have already been loaded, it does not quite make sense to me that QV complains about 'field not found'.. 

so, if I have a table T1 with a field F1, another table T2 with a field F2, and I want to load from T2 all data whose F2 values exist in F1 , I should write something like this,

Load * resident T2

where exists(F1, F2);

right?

zzyjordan
Creator II
Creator II

exactly 🙂

And the example from online helper probably makes more sense

https://help.qlik.com/en-US/qlikview/November2018/Subsystems/Client/Content/QV_QlikView/Scripting/In...

ZZ