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

How to use multiple values in a Like function

Started by v2k4u, 22 Oct 2014 03:02:41 PM

Previous topic - Next topic

v2k4u

Hi Gurus,

I have a question on using the Like function. Can we use the Like function for mutliple values, for Ex: [Region] Like ('%A','%B','%C') or should we be using it as ([Region] Like ('%A') and [Region] Like ('%B') and [Region] Like ('%C') ).

Please help me with your valuable suggestions.

Thanks

Lynn

You will never find any region that is like %A AND %B since it can only end in one letter.

I don't believe that like allows multiple values. Therefore go with your second approach, but use OR rather than AND

MFGF

Hi,

Personally I would opt for:

[Region] ends with 'A' OR [Region] ends with 'B' OR [Region] ends with 'C'

:)

MF.
Meep!

cognos810

Hello v2k4u,
Do you absolutely have to use LIKE ?

Same this can be achieved as such....ignore it if you have to use LIKE.

substring([Region],character_length([Region])) in ('A','B','C')

-Cognos810

CognosPaul