Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
t_hylander
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!

1 Solution

Accepted Solutions
Miguel_Angel_Baeyens

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
Miguel_Angel_Baeyens

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

t_hylander
Creator
Creator
Author

Thanks, works perfect.

Sometimes the answer is right in front of you.