Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
how to define this condition
if(tab1.dept_id='global' then tab2.dept_id
else tab1.dept_id)
in tab1 table, if the script is as below;
Qualify b_id;
l
oad a,d,c,b_id,dept_id;
SQL select * from tab1;
Qualify b_id;
load f,g,j,kk,
b_id,dept_id;
SQL Select * from tab1;
Hi,
You should use a mapping load with an ApplyMap(), as follows:
Table2Map;
MAPPING LOAD b_id, dept_id; // b_id or the unique identifier between both tables
SQL select * from tab1;
Table1:LOAD f, g, j, kk,
b_id,
If(dept_id = 'global', ApplyMap('Table2Map', b_id), dept_id) AS dept_id_new;
SQL Select * from tab1;
Hope that helps.
Miguel
Hi,
You should use a mapping load with an ApplyMap(), as follows:
Table2Map;
MAPPING LOAD b_id, dept_id; // b_id or the unique identifier between both tables
SQL select * from tab1;
Table1:LOAD f, g, j, kk,
b_id,
If(dept_id = 'global', ApplyMap('Table2Map', b_id), dept_id) AS dept_id_new;
SQL Select * from tab1;
Hope that helps.
Miguel
Thank you