Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

LOOKUP FUNCTION

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;



1 Solution

Accepted Solutions
Not applicable
Author

Hi Pranita ,

Hope this is what u r looking for .

let me know in case of further assitance.

Cheers ,

Bhushan N

View solution in original post

3 Replies
pover
Luminary Alumni
Luminary Alumni

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;

Not applicable
Author

Hi

TEST3:





LOAD

*,LOOKUP('VALUE',KEY,KEY,'TEST1') AS

TEST

RESIDENT

TEST2;





Not applicable
Author

Hi Pranita ,

Hope this is what u r looking for .

let me know in case of further assitance.

Cheers ,

Bhushan N