Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I am struggling with the following:
I have created the following table:
Table1: | |
Key_1 | Team_1 |
A1 | A |
A2 | B |
I have created a second table:
Table 2 | |
Key_2 | Team_2 |
Q1 | F |
A1 | G |
Z3 | Z |
A2 | T |
I try to update 'Table2.Team_2' field value with 'Table1.Team_1' field value where 'Table2.Key_2' field value match 'Table1.Key_1' field value.
I expect the following result:
Table 2 | |
Key_2 | Team_2 |
Q1 | F |
A1 | A |
Z3 | Z |
A2 | B |
I have tried to solve this with combining If exists in combination with lookup. This did not worked.
I would really be grateful if you could help me with this issue.
Thanks,
Tarik
Table1_map:
LOAD key_1,
Team_1
FROm table1;
Table2:
LOAD Key_2,
Team_2,
applymap('Table1_map',Key_2,Team_2) as Team2_New
FROM table2;
Table1_map:
LOAD key_1,
Team_1
FROm table1;
Table2:
LOAD Key_2,
Team_2,
applymap('Table1_map',Key_2,Team_2) as Team2_New
FROM table2;
Thank you very much for your time and help me! It is working as it should.