Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Please help me with lookup function.
TEST1:
LOAD * INLINE [
KEY, VALUE
KEY1, 1
KEY2, 2
KEY3, 3
];
TEST2:
LOAD * INLINE [
KEY, VAL
KEY1, A
KEY2, B
KEY3, C
];
I need test 3 table to populate as
KEY,Val,Value (which comes from test1 table)
TEST3:
LOAD *,LOOKUP(VALUE,KEY,KEY,'TEST1') AS TEST
RESIDENT TEST2;
DROP TABLE TEST1;
DROP TABLE TEST2;
Hi Pranita ,
Hope this is what u r looking for .
let me know in case of further assitance.
Cheers ,
Bhushan N
Use the mapping load and applymap function as done below. Note that mapping load tables don't need to be dropped.
Edit: And if you want to use your lookup function just add single quotes to the first 2 parameters: LOOKUP('VALUE','KEY',KEY,'TEST1')
TEST1:
MAPPING
LOAD * INLINE [
KEY, VALUE
KEY1, 1
KEY2, 2
KEY3, 3
];
TEST2:
LOAD * INLINE [
KEY, VAL
KEY1, A
KEY2, B
KEY3, C
];
I need test 3 table to populate as
KEY,Val,Value (which comes from test1 table)
TEST3:
LOAD *,applymap('TEST1',KEY) AS TEST
RESIDENT TEST2;
//DROP TABLE TEST1;
DROP TABLE TEST2;
Hi
TEST3:
LOAD
*,LOOKUP('VALUE',KEY,KEY,'TEST1') ASTEST
RESIDENT
TEST2;
Hi Pranita ,
Hope this is what u r looking for .
let me know in case of further assitance.
Cheers ,
Bhushan N