COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: sg on 15 Jul 2009 10:42:08 AM

Title: How to implement in an expression
Post by: sg on 15 Jul 2009 10:42:08 AM
Hi,

I need to implement the below query. But this does not work in an expression. It throws the error.Please let me know how to be done.

Except(Filter([Price Analysis].[Product].[All Products].Children,
   InStr([Price Analysis].[Product].CurrentMember.Name, "GIRL") > 0),
   Filter([Price Analysis].[Product].[All Products].Children,
   InStr([Price Analysis].[Product].CurrentMember.Name, "TEEN") > 0))}

Let me know if more information is required. Any help in this regard will be appreciated.

Thanks,
sg


Title: Re: How to implement in an expression
Post by: redmist on 15 Jul 2009 10:54:02 AM
HI,

You seem to be using MDX functions (Except and Filter) and Relational functions (InStr).
I am assuming you want all the categories in Products except GIRL and TEEN.

You can create a data item, call it Exception = set([GIRL],[TEEN])

Your expression would then be

Except([Price Analysis].[Product].[All Products].Children, Exception)

Let me know if my assumption is wrong
Title: Re: How to implement in an expression
Post by: sg on 16 Jul 2009 05:58:19 AM
No I Want to display all the name start with teen but not start with girl.
Title: Re: How to implement in an expression
Post by: redmist on 16 Jul 2009 11:32:28 AM
try this

filter( children([Price Analysis].[Product].[All Products]), (caption(<LEVEL_NAME>) like 'TEEN%'))

this would bring in only names starting with TEEN
Title: Re: How to implement in an expression
Post by: sg on 17 Jul 2009 04:43:45 AM
Thank you very much for the reply.

Now i want to include the below condition along with TEEN ,

([CUBE].[Product].[Part Description].[Part Description], [Sales Revenue] > 1000

Please let me knw the correct syntax. I am not aware of the MDX queries and it throws the error.Please let me know.

Thanks,
sg