COGNOiSe.com - The IBM Cognos Community

IBM Cognos Analytics Platform => Cognos Analytics => Reporting => Topic started by: t0mato on 26 Jul 2021 01:33:45 PM

Title: Syntax for Filtering a Field With Operator - SOLVED PLEASE REMOVE
Post by: t0mato on 26 Jul 2021 01:33:45 PM
Hello,

I want to be able to filter my field [Job Title] to include anything with the following text in its string: mgr, supervisor, manager.

My thoughts are that all I would need to do is write the express definition: [Job Title] CONTAINS "%mgr,%supervisor"

But I don't really know the syntax very well for writing this stuff, so of course i'm given an error with this.

Any help would be greatly appreciated!
Title: Re: Syntax for Filtering a Field With Operator
Post by: t0mato on 26 Jul 2021 02:02:47 PM
Problem SOLVED - PLEASE REMOVE THREAD
Title: Re: Syntax for Filtering a Field With Operator - SOLVED PLEASE REMOVE
Post by: MFGF on 26 Jul 2021 02:07:30 PM
Quote from: t0mato on 26 Jul 2021 01:33:45 PM
Hello,

I want to be able to filter my field [Job Title] to include anything with the following text in its string: mgr, supervisor, manager.

My thoughts are that all I would need to do is write the express definition: [Job Title] CONTAINS "%mgr,%supervisor"

But I don't really know the syntax very well for writing this stuff, so of course i'm given an error with this.

Any help would be greatly appreciated!

A simple solution would be:

[Job Title] contains 'mgr' or [Job Title] contains 'supervisor' or [Job Title] contains 'manager'

I saw your request to remove the post because you solved it, but one of the great things about this forum is showing others how something is solved. If you have a different solution, please share it so that others might read it in future and know what works.

Cheers!

MF.
Title: Re: Syntax for Filtering a Field With Operator - SOLVED PLEASE REMOVE
Post by: t0mato on 26 Jul 2021 05:37:37 PM
And that's exactly what I ended up doing! How would I exclude something, however? If i wanted to exclude a certain title, like Supervisor 2, would it be:

OR [Job Title] NOT CONTAINS 'Supervisor 2'

?