If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Help simplify long "not like" filter statemet with wildcards

Started by Todd129, 19 Dec 2012 11:31:29 AM

Previous topic - Next topic

Todd129

Hi all --

I am trying to simplify a long, inelegant "not like" filter with wildcards (below). I have not been able to condense the statement without errors. Many thanks for sharing your expertise on this board.  -- THE NOOB

[DOC_CONTROL_ANALYST_NAME] not like 'CBL%' AND[DOC_CONTROL_ANALYST_NAME] not like 'SYBR%' AND[DOC_CONTROL_ANALYST_NAME] not like 'OXALIC%' AND[DOC_CONTROL_ANALYST_NAME] not like 'TRIZMA%' AND[DOC_CONTROL_ANALYST_NAME] not like 'QS12K%' AND[DOC_CONTROL_ANALYST_NAME] not like 'STPR%' AND
[DOC_CONTROL_ANALYST_NAME] not like '(G5%'  AND
[DOC_CONTROL_ANALYST_NAME] not like 'RNase%' AND
[DOC_CONTROL_ANALYST_NAME] not like 'BLANK%'  AND
[DOC_CONTROL_ANALYST_NAME] not like 'REL ATTUNE%' AND
[DOC_CONTROL_ANALYST_NAME] not like 'Part 2%' AND
[DOC_CONTROL_ANALYST_NAME] not like 'RELEASE BOMS%' AND
[DOC_CONTROL_ANALYST_NAME] not like 'Release new RMs%'

blom0344

What is the error message?

delete [DOC_CONTROL_ANALYST_NAME] not like '(G5%'  AND
from the expression

What happens?

Todd129

Hi there --

The above expression works fine. But I would have liked to write it a  form like [Data Item] not like ('A%', 'B%', 'C%') or something similar instead of using all of those AND statements.

When I try this approach I get the error:

QE-DEF 49 CCLException
QE-DEF-0260 Parsing error before or near position: 31 of: [APPROVED_BY] NOT LIKE ('A%' , 'B%')
QE-DEF-0261 QFWP - Parsing text: [APPROVED_BY] NOT LIKE ('A%' , 'B%')


blom0344

like and not like do not accept an array, only single values.  Perhaps yhou could use the substring function to some extend to cluster values that have the same length