Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Table A:
Name | ID |
A | 1 |
B | |
C | 5 |
D | |
E | 7 |
Table B:
Name | ID |
A | 20 |
B | 2 |
C | 99 |
D | 9 |
E | 7 |
F | 8 |
I | 10 |
J | 11 |
K | 15 |
Result:
Name | ID |
A | 20 |
B | 2 |
C | 99 |
D | 9 |
E | 7 |
I want to replace and fill the null ID values from Table B in Table A.
NameIdMap:
Mapping Load Name, ID
From TableB
Table_A:
Load Name,
if(len(ID) > 0, ID, ApplyMap('NameIdMap', Name)) as ID
From TableA
I tried this but this does not replace ID values in TableA with the values in Table B
Further simplified.
Mapper:
Mapping
LOAD * INLINE [
Name, ID
A, 20
B, 2
C, 99
D, 9
E,
F, 8
I, 10
J, 11
K, 15
];
tab1:
LOAD Name, Alt(ApplyMap('Mapper',Name,ID),ID) As ID INLINE [
Name, ID
A, 1
B,
C, 5
D,
E, 7
Z, 88
];