Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Colleagues, good day!
Simple question:
Script loads first table:
Id | Field1 |
1 | A |
2 | A |
3 | A |
4 | A |
5 | A |
6 | A |
Then i must load second table but only data for those Id which are not contain in first table:
Second:
Id | Field2 |
1 | B |
2 | B |
3 | B |
4 | B |
8 | B |
9 | B |
In result i must get only:
Id | Field2 |
8 | B |
9 | B |
Thanks.
Try on your second load :
where not exists (Id)
May be like this:
A:
LOAD Id,
Field1
FROM....
B:
LOAD Id,
Field2
FROM ...
Where not Exists(Id);
DROP Table A;
Thanks!
It works.
But how QV Know, what previous table must be checked for already exist values? (Id in this case)
Maybe like this?
temp1:
Load * Inline [
Id, Field1
1,A
2,A
3,A
4,A
5,A
6,A
];
TEMP2:
NoConcatenate
Load *
Where Not Exists (Id);
Load * Inline [
Id, Field1
1,B
2,B
3,B
4,B
8,B
9,B
];
Drop Table temp1;
QlikView checks the data model for the field Id and looks up values already loaded into the field. This is done at the field level, not the table level.
This is how Exist function works where it checks against all possible value within a field previously loaded in the script.
Qlik checked for this the values within the symbol-tables, see here what is meant: Symbol Tables and Bit-Stuffed Pointers.
- Marcus
Thanks))
And is is possible to check for some fields combinations?
For ex:
First table:
Id | F1 |
1 | A |
2 | A |
3 | A |
4 | A |
5 | B |
6 | B |
Second:
Id | F1 |
1 | 3 |
2 | ed |
3 | fd |
4 | dfd |
5 | fdf |
6 | B |
7 | u |
for where not Exists(Id&F1) i must get only:
Id | F1 |
5 | fdf |
7 | u |
but it returns empty result
Thanks!