Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Ho everyone,
what i would like to do is to create a new field in the first table if exist values in another table.
Table1:
LOAD * INLINE [
A
1
2
3
4
5
6
7
8
];
Table2:
LOAD * INLINE [
A
2
3
4
10
11
12
];
What I'd like to do is to create a "B" field in the Table1 where the values are:
- "OK" if the value in the field A of Table1 exist in the field A of Table2;
- "KO" if the value in the field A of Table1 does not exist in the field A of Table2.
Is that clear enough?
The field "B" in the "New" Table1 should be:
B
KO
OK
OK
OK
KO
KO
KO
Here attached my qvw example.
Thank u all.
Filiberto
Hi,
one solution could be:
Table2:
LOAD * INLINE [
A
2
3
4
10
11
12
];
Table1:
LOAD *,
If(IsNull(Lookup('A','A',A,'Table2')),'KO','OK') as B
INLINE [
A
1
2
3
4
5
6
7
8
];
hope this helps
regards
Marco
Hi,
one solution could be:
Table2:
LOAD * INLINE [
A
2
3
4
10
11
12
];
Table1:
LOAD *,
If(IsNull(Lookup('A','A',A,'Table2')),'KO','OK') as B
INLINE [
A
1
2
3
4
5
6
7
8
];
hope this helps
regards
Marco
Another solution could be using Mapping Load:
Table2:
Mapping
LOAD * INLINE [
A, B
2, OK
3, OK
4, OK
10, OK
11, OK
12, OK
];
Table1:
LOAD A,
ApplyMap('Table2', A, 'KO') as B;
LOAD * INLINE [
A
1
2
3
4
5
6
7
8
];