Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a 2 tables,
Table1:
Load * inline [
Id,remark
1,abc1
2,def1
3,efg1
];
Table2:
Load * inline [
Id,remark,otherFeilds
1,abc,xyz
2,def,mno
3,efg,pmo
4,ghi,ter
5,ijk,zxy
];
I need to change value of remark feild in Table2 while loading according to the values in Table1. Other values remain same.
My final result would be like..
Id,remark,otherFeilds
1,abc1,xyz
2,def1,mno
3,efg1,pmo
4,ghi,ter
5,ijk,zxy
Could someone suggest me a suitable way?
If you are not using an Inline load, then yes
Table1:
Mapping
LOAD * INLINE [
Id, remark
1, abc1
2, def1
3, efg1
];
Table2:
LOAD Id,
ApplyMap('Table1', Id, remark) as remark,
otherFeilds
FROM someQVD.qvd (qvd);
Try this
Table1:
Mapping
LOAD * INLINE [
Id, remark
1, abc1
2, def1
3, efg1
];
Table2:
LOAD Id,
ApplyMap('Table1', Id, remark) as remark,
otherFeilds;
LOAD * INLINE [
Id, remark, otherFeilds
1, abc, xyz
2, def, mno
3, efg, pmo
4, ghi, ter
5, ijk, zxy
];
applymap with a default beeing what the value in table2 is?
Depending on how many records are in table 1, a mapping table would work:
Table1:
Mapping
Load * inline [
Id,remark
1,abc1
2,def1
3,efg1
];
Table2:
load Id,
Applymap('Table1',Id,remark) as remark,
otherFeilds;
Load * inline [
Id,remark,otherFeilds
1,abc,xyz
2,def,mno
3,efg,pmo
4,ghi,ter
5,ijk,zxy
];
Thanks for your response, but is there a way to achieve the result without using preceeding load?
If you are not using an Inline load, then yes
Table1:
Mapping
LOAD * INLINE [
Id, remark
1, abc1
2, def1
3, efg1
];
Table2:
LOAD Id,
ApplyMap('Table1', Id, remark) as remark,
otherFeilds
FROM someQVD.qvd (qvd);
Thank you all for your response. The solution proposed worked for me!!