Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
tkw8000
Contributor II
Contributor II

Load Where Statement with Multiple Criteria, AND not working

Trying to load records that have fieldname "CHNG_ORD_SEQ"=1 and fieldname "CHNG_ORD_BATCH"=0, and CHNG_ORD_SEQ=0 and CHNG_ORD_BATCH=1, and anything with either field >0

Only want to eliminate records with zero in both fields.

I have written the code below, but it eliminates any record with a 0 in either field.  Any ideas on why the AND is being ignored?

where (OPRID_MODIFIED_BY <> 'POCHNG')

and ("CHNG_ORD_SEQ"<>'0') and ("CHNG_ORD_BATCH"<>'0');

Thanks,

7 Replies
Vegar
MVP
MVP

Try to handle the zero as numeric, no ' ' around the 0.

where (OPRID_MODIFIED_BY <> 'POCHNG') and ("CHNG_ORD_SEQ"<>0) and ("CHNG_ORD_BATCH"<>0);

 

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

where (OPRID_MODIFIED_BY <> 'POCHNG')

and ("CHNG_ORD_SEQ"<>'0') or ("CHNG_ORD_BATCH"<>'0') );

I believe that should be an "or". Also note the extra parens required. 

-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com

tkw8000
Contributor II
Contributor II
Author

Thanks for the reply.

tkw8000
Contributor II
Contributor II
Author

Thank you but this did not work.

tkw8000
Contributor II
Contributor II
Author

Sorry but this did not work.  Do you think I should use an IF statement instead?

Vegar
MVP
MVP

It feels like there is something with your scenario that is not taken into consideration. Har to pinpoint without the actual application at hands.

You could give this a try

where

   (OPRID_MODIFIED_BY <> 'POCHNG')

   and 

   RangeSum("CHNG_ORD_SEQ", "CHNG_ORD_BATCH")>0;

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

The best way to sort this out to load all the data (or a limited load of some number of rows).  Put the Fields as Dimensions in a straight table and the where clause (everything but "where") as expression.  See what it returns and play with it until you get -1 for the rows you want and 0 for the  rows you don't.

-Rob