Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikWorld, June 24-25, 2020. Free virtual event for Data Integration and Data Analytics gurus. Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator
Creator

Using IF in load-section

Hi,

Perhaps a simple question but couldnt find any answer how I use IF in load-section.

I have a table with a row of notes, ex.:

1, Table, 299, DAMAGED Missing 2 legs

2, Chair, 99, Includes two small sidetables

...

What I want is to easy select all "DAMAGED" goods, making a new column with a boolean (DAMAGED=1/0)

LOAD ...

IF(left(ANM, 7) ='DAMAGED'), DAMAGED=1, DAMAGED=0) as DAMAGED,

..

;

SQL SELECT ...

When using this I get a error saying "Couldnt find field <DAMAGED>".

What is it Im doing wrong?

Thanks!

Tags (2)
1 Solution

Accepted Solutions
Highlighted

Re: Using IF in load-section

Hello,

You are very close to the final result. As you are creating a new field based on fields that still not exist in the QlikView model, the assignment of values will look like

LOAD ....

IF(left(ANM, 7) ='DAMAGED'), 1, 0) as DAMAGED,

....

Hope that helps.

Miguel Angel Baeyens

BI Consultant

Comex Grupo Ibérica

View solution in original post

2 Replies
Highlighted

Re: Using IF in load-section

Hello,

You are very close to the final result. As you are creating a new field based on fields that still not exist in the QlikView model, the assignment of values will look like

LOAD ....

IF(left(ANM, 7) ='DAMAGED'), 1, 0) as DAMAGED,

....

Hope that helps.

Miguel Angel Baeyens

BI Consultant

Comex Grupo Ibérica

View solution in original post

Highlighted
Creator
Creator

Using IF in load-section

Thanks, works perfect.

Sometimes the answer is right in front of you.