Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

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
MVP & Luminary
MVP & Luminary

Re: Load Script: Using Lookup() in an If statement

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
2 Replies
MVP & Luminary
MVP & Luminary

Re: Load Script: Using Lookup() in an If statement

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

Re: Load Script: Using Lookup() in an If statement

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!