Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Lookup() function not working as expected.

Hi,

If I run the following code it produces an error. Field not found <descr>. It appears the table argument in the lookup function is being ignored. Am i doing something wrong?

[]

t1:
LOAD * INLINE [
index,descr
1,'Active'
];

t2:
LOAD * INLINE [
ProdCode, Status_index
D456785,1
];

t3:
LOAD *,
LOOKUP(descr,index,'1','t1') as Satus_descr
RESIDENT t2

[/]

Mark

1 Solution

Accepted Solutions
johnw
Champion III
Champion III

You need single quotes around the field names in the lookup() function. I'm not saying I agree with this syntax, mind you, just that it is what it is. Also, since index is a numeric literal, I don't think it shoudl have single quotes. So I'm hoping this works?

lookup('descr','index',1,'t1')

View solution in original post

2 Replies
johnw
Champion III
Champion III

You need single quotes around the field names in the lookup() function. I'm not saying I agree with this syntax, mind you, just that it is what it is. Also, since index is a numeric literal, I don't think it shoudl have single quotes. So I'm hoping this works?

lookup('descr','index',1,'t1')

Not applicable
Author

Thank you