COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: stnunn on 15 Feb 2010 06:25:50 PM

Title: Multi-line Like Parameter
Post by: stnunn on 15 Feb 2010 06:25:50 PM
I would like to do a "multi-line like" parameter in Report Studio, but this doesn't seem to be available.  It is, however, available in Query Studio as "Matches SQL Pattern".  When opening the QS report in RS, it looks like it's using a macro (note the #'s).

Here is what the QS code looks like in RS:

#join('or',substitute('^','[ITEM] like ',sq(array('%123%','%456%'))))#

In other words, I want to find everything like 123 or like 456.

I tried using a multi-line text box prompt and putting ?parameter? where we see '%123%','%456%', but no luck.

Any ideas?
Thanks!
Title: Re: Multi-line Like Parameter
Post by: CognosPaul on 16 Feb 2010 02:50:02 AM
?parameter? is a prompt alias. You'd need to use the real prompt macro for it to work. So try using:


#join('or',substitute('^','[ITEM] like ',sq(array(promptmany('par','string')))))#

Title: Re: Multi-line Like Parameter
Post by: cogan on 16 Feb 2010 05:10:54 AM
I was just going to ask the same question! Thank you PaulM!!
Title: Re: Multi-line Like Parameter
Post by: lindero on 17 Feb 2010 08:42:40 AM
Hi,

sometimes there is a database function which can handle your requirement without using prompt macros.

On Teradata database the magic word is "like some".

i.e.:

[column] like some ('%123%,'%345%')

so maybe you database are also able to do this.

cheers...