Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

RESIDENT WHERE AND OR

Hi,

I have a resident load with WHERE Status = 'Open' and Type = '1' OR '2'

The result isnt't correct.

WHERE WHERE Status = 'Open' works

and

WHERE Type = '1' OR '2' works

Any ideas what the problem could be?

Thanks

Aloah

3 Replies
Not applicable
Author

Hello Aloah,

I don't see any problem in your current statement, but maybe you can try this:

WHERE (Status = 'Open') AND (Type = '1' OR Type = '2')


regards,

Mark

Not applicable
Author

Check your field name, it may be case sensitive.

johnw
Champion III
Champion III

Are you SURE that Type = '1' OR '2' works? I didn't think that was a valid format for QlikView, or more accurately, I wouldn't expect it to do what you say it's doing.

I would expect it to do this:

(Type = '1') OR ('2')

The string '2' does not equal FALSE (0), so I'd expect it to be true. Therefore the whole expression should be true, and I would expect you to retrieve ALL rows.

I would expect the same problem with the full expression. AND is generally evaluated before OR, so once again, I would expect you to retrieve all rows.

The QlikView format for this would be this:

WHERE STATUS = 'Open' and Match(Type,'1','2')