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

Double 'if' condition in load script?

Hi,

I was wondering if you could help me.

I have a large dataset from which I would like to load into my QV only observations for which EITHER of the following two fields equals to 10: Home_location or Work_location.

While I've thought of other ways to extract only the data needed, I'm wondering whether it's possible to use a condition in the load script to load only data where either Home_location=10 or Work_location=10. I need to keep both these fields in the data.

I would greatly appreciate any suggestions. I've attached a sample data, actual dataset is much bigger.

Many thanks in advance,

Marketa

1 Solution

Accepted Solutions
robert_mika
Master III
Master III

LOAD WorkerID,

     Home_location,

     Work_location,

     Hours

FROM

(ooxml, embedded labels, table is Sheet1)

WHERE Home_location=10 OR Work_location=10

View solution in original post

5 Replies
robert_mika
Master III
Master III

LOAD WorkerID,

     Home_location,

     Work_location,

     Hours

FROM

(ooxml, embedded labels, table is Sheet1)

WHERE Home_location=10 OR Work_location=10

Anonymous
Not applicable
Author

Add one line to your script:

LOAD WorkerID,
Home_location,
Work_location,
Hours
FROM

(
ooxml, embedded labels, table is Sheet1)
WHERE Home_location=10 OR Work_location=10;


Not applicable
Author

Wonderful, thank you both! I knew there must have been some simple solution....

Thanks!

robert_mika
Master III
Master III

You are welcome.

Thanks for feedback

Anonymous
Not applicable
Author

or

WHERE 10 in (Home_location,Work_location)