COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: JoOne on 09 Oct 2009 02:47:38 AM

Title: Some help with a filter?
Post by: JoOne on 09 Oct 2009 02:47:38 AM
Hello all,

I´m trying to create a report in C8 that looks like one that is made in Impromtu, but I can´t get the filter right.

Here's how the filter looks like in Impromtu:
if (Reason <= 'R06' or Reason in ('R10','R11))
then (Reason)
else ('Övr')

But when I try this in C8, I get all kinds of errors like parsing errors and such. I believe that it's not that easy to just copy the old filter straight off from Impromtu...

For me, the operator "<=" can't be right when working with strings. Does anybody have any useful insights regarding this filter?
Thanks for any reply.

BR
Johan
Title: Re: Some help with a filter?
Post by: blom0344 on 09 Oct 2009 08:21:41 AM
Just to check, how do you want to evaluate the value of the string 'R06' in a les-or-equal-to  operator?
Do you want 'R05' to pass and 'S00' to be excluded?
Title: Re: Some help with a filter?
Post by: JoOne on 09 Oct 2009 08:53:32 AM
Hi,

Yes, I want to show R00, R01, R02 and so on up to R06, then include R10 and R11. The rest should fall under 'Övr' ("others" in swedish  :))
Title: Re: Some help with a filter?
Post by: blom0344 on 09 Oct 2009 09:47:09 AM
And you would not settle for:

Reason in ('R00','R01','R02','R03','R04','R05','R10','R11')  ?


Title: Re: Some help with a filter?
Post by: JoOne on 12 Oct 2009 02:04:42 AM
Hi,

No, it fails..
Here's how it looks:

IF ( [transaction].[transaction Type].[transaction Type (Document type, reason)].[Reason].[REASON] in ('R00','R01','R02','R03','R04','R05','R10','R11') ) THEN
    ( [transaction].[transaction Type].[transaction Type (Document type, reason)].[Reason].[REASON] )
ELSE
    ( 'Övr' )

I get two parsing errors near position 108. I will have to check that position. Thanks anyway for the help.
Title: Re: Some help with a filter?
Post by: JoOne on 12 Oct 2009 02:25:04 AM
I applied the filter in the Data Item Expression instead. This seems to work.
Title: Re: Some help with a filter?
Post by: blom0344 on 12 Oct 2009 04:29:22 AM
Yes, and that's the place where it belongs. It is indeed an expression and not a filter. A filter would be when you create a subset from data returned. Your intent is not to limit data fetched but to manipulate WHAT you fetch..