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

Load Script: Using Lookup() in an If statement

Hello,

I am wondering if it is possible to use Lookup() in an if statement. Below you can see an example:

Bron1:

LOAD Para1,

     Doel as A

FROM

TEST_QV.xlsx

(ooxml, embedded labels, table is C);

Fact:

LOAD Nr,

     Para1 AS P1,

     Art As Art1,

     If(Para1='B1',lookup('Doel','Para1',Para1,'Bron1'),'A')  AS Doel    

FROM

TEST_QV.xlsx

(ooxml, embedded labels, table is A);

See the attached file and the result.

1 Solution

Accepted Solutions
Gysbert_Wassenaar

It's certainly possible. However you renamed Doel to A in your first load, so the field Doel doesn't exist, but A does. Change your lookup accordingly.


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar

It's certainly possible. However you renamed Doel to A in your first load, so the field Doel doesn't exist, but A does. Change your lookup accordingly.


talk is cheap, supply exceeds demand
Not applicable
Author

Thanks a lot

I was expecting that he would still look at the original name, but it works now! Sometimes you're almost there but just need a 2nd person to take out the last bug!