Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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!
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
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
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?
exactly 🙂
And the example from online helper probably makes more sense