Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
If i want to do a lookup on the primary key in another table and if the value is matching I want to display flag = 1 or flag =0.
Can someone help me how to do this.
Updated the post with an example. But lookup doesnt seem to work here...can someone help me whats wrong in it?
Thanks
in script?
// test tables t1 t2
t1:
load * inline [
field1, field11
a,1
b,2
c,3
];
t2:
load * inline [
field1, field22
a,1
c,3
d,4
];
// calc flag
map: Mapping LOAD field1, 1 Resident t1;
left join (t2)
load field1, ApplyMap('map', field1, 0) as flag
Resident t2;
Please Provide sample application and requirements in detail
in script?
// test tables t1 t2
t1:
load * inline [
field1, field11
a,1
b,2
c,3
];
t2:
load * inline [
field1, field22
a,1
c,3
d,4
];
// calc flag
map: Mapping LOAD field1, 1 Resident t1;
left join (t2)
load field1, ApplyMap('map', field1, 0) as flag
Resident t2;
yes.in the script.
I want to do the other way. want to see flag values in t1.
posted
if you want the flag in t1
t1:
load * inline [
field1, field11
a,1
b,2
c,3
];
t2:
load * inline [
field1, field22
a,1
c,3
d,4
];
map: Mapping LOAD field1, 1 Resident t2;
left join (t1)
load field1, ApplyMap('map', field1, 0) as flag
Resident t1;
My tables t1 and t2 are really huge.
due to the left join, its creating duplicate records in the qvds that I am storing t1 and t2 into .
If i chnage it to left keep the qvd shows unique records and is proper..but it generates map table in the model which is not required.
If i use Drop table map;
at the end after using keep, it drops flag field....any solution here?
1:
load * inline [
field1, field11
a,1
b,2
c,3
];
t2:
load * inline [
field1, field22
a,1
c,3
d,4
];
map: Mapping LOAD field1, 1 Resident t2;
left keep (t1)
load field1, ApplyMap('map', field1, 0) as flag
Resident t1;