Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Friends,
I have two values like x from A table and y from B table.
I want to create a Table by taking difference of x an y.
Thanks
pavan
assuming there is a common field you can define:
tmptest:
noconcatenate load
key,
x
resident A
left join (tmptest)
load
key,
y
resident B
test:
noconcatenate load
key,
x,
y,
x-y as diff
resident tmptest
drop table tmptest
hope that helps
Pavan,
This can be possible with Resident load, please see below yon do something like that :
Resident load is like this.
TableA:
select columna, value, columnb
from table1;
TableB:
select columna, sum(value)
resident TableA
group by columna;
Thanks,
AS
Thanks Rudolf
Getting error after resident A. not able to use left join.
Temptest:
NoConcatenate Load
key,
PremiumOGIS Resident OGIS
left
Hi Pavan,
Try like this
Temp:
load
key,
x
resident A;
left join (Temp)
load
key,
y
resident B;
Data:
load
key,
x,
y,
x-y as diff
resident Temp;
drop table Temp
Hope this helps you.
Regards,
Jagan.
please post sample data of both tables
Hi pavan,
I suggest to make a mpaping from one table and then use an applymap to the sencond.
Table_A:
Load key,
x
From.......;
Map_Table:
Mapping Load key,
x
Resident Table_A;
Table_B:
Load key,
(applymap('Map_Table',key,Null()) - y) as Diference
From.....;
Hope helps.