Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I wan to do a calculation in the load with two fields that were brought in through different tables.
Example:
Mort_dt - Min(Place_Date)/7 as MortWeek
Mort_dt was brought in by a table named tblGAGroupMort
Place_Date was brought in by a table named tblGAGroupPlac
Any help you can offer will be greatly appreciated.
if you just need the Min(Place_Date) from tblGAGroupPlac. then you can use like below.
tab1:
load * from tblGAGroupPlac;
tmp:
load Min(Place_Date) as mindt resident tab1;
let vMinDate = peek('mindt',0,'tmp');
drop table tmp;
tab2:
load *, (Mort_dt - '$(vMinDate)')/7 as MortWeek from tblGAGroupMort
HI,
Join the two tables and then use the resident load and apply the condition on the two columns in the resident load table.
For ex:
tab1:
load a,b,c
from tab1;
join
load c,d,e from tab2;
now
load if(a>d,'above','below') as compare,a,b,c,d resident tab1;
Thanks,
Anjee