Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikView forum consolidation is complete. Labels are now required. LEARN ABOUT LABELS
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
Partner
Partner

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);

 

Plees ekskuse my Swenglish and or Norweglish spelling misstakes
rwunderlich
MVP & Luminary
MVP & Luminary

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

Thanks for the reply.

tkw8000
Contributor II
Contributor II

Thank you but this did not work.

tkw8000
Contributor II
Contributor II

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

Vegar
Partner
Partner

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;

Plees ekskuse my Swenglish and or Norweglish spelling misstakes
rwunderlich
MVP & Luminary
MVP & Luminary

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