Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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
Highlighted

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
Highlighted

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

Highlighted
Champion III
Champion III

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;


Highlighted
Not applicable

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

Thanks!

Highlighted

You are welcome.

Thanks for feedback

Highlighted
Creator II
Creator II

or

WHERE 10 in (Home_location,Work_location)