Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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
Check your field name, it may be case sensitive.
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')