COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: rob8143 on 06 Jan 2010 10:00:34 AM

Title: Trying to write an 'is missing' Filter
Post by: rob8143 on 06 Jan 2010 10:00:34 AM
Good Morning,

I am trying to write an 'is missing' filter in a folder.  For some reason the Filter

[Course Code]='XXX XXX'   works with no errors in Validation but
[Course Code]is missing'XXX XXX' will not work.

I am VERY VERY Green when it comes to Cognos, so I am wondering if there is something simple here.

Thanks
Title: Re: Trying to write an 'is missing' Filter
Post by: MFGF on 06 Jan 2010 10:12:30 AM
Hi,

Could you explain exactly what you are trying to achieve with the filter?

[Course Code] = 'XXX XXX'      will return rows where the course code is XXX XXX
[Course Code] is missing      will return rows where course code is null (ie rows without a course code)
[Course Code] <> 'XXX XXX'      will return rows where the course code is not XXX XXX

Do any of these suit your requirement, or are you looking for something else?

Regards,

MF.
Title: Re: Trying to write an 'is missing' Filter
Post by: rob8143 on 06 Jan 2010 02:02:19 PM
Hi MF,

Essentially what I am trying to accomplish is a report that shows all employees who do not have that specific course code in their profile. In this case it would be the 'XXX XXX'

Thanks,
Rob
Title: Re: Trying to write an 'is missing' Filter
Post by: anilkumar on 07 Jan 2010 01:23:50 AM
u can use not starts with'xxxxxx'
Title: Re: Trying to write an 'is missing' Filter
Post by: jahnavi on 07 Jan 2010 02:41:15 AM
You can use 'not in' to filter this
Title: Re: Trying to write an 'is missing' Filter
Post by: MFGF on 07 Jan 2010 03:15:12 AM
Quote from: rob8143 on 06 Jan 2010 02:02:19 PM
Hi MF,

Essentially what I am trying to accomplish is a report that shows all employees who do not have that specific course code in their profile. In this case it would be the 'XXX XXX'

Thanks,
Rob

Thanks.

How about:

[Course Code] <> 'XXX XXX' or [Course Code] is missing

MF.
Title: Re: Trying to write an 'is missing' Filter
Post by: rob8143 on 07 Jan 2010 09:54:58 AM
Is there a reason I get an error every time I use another operator other than the = sign?
Title: Re: Trying to write an 'is missing' Filter
Post by: MFGF on 07 Jan 2010 10:03:46 AM
What is the exact expression you are using, and what does the error say?

MF.
Title: Re: Trying to write an 'is missing' Filter
Post by: rob8143 on 07 Jan 2010 12:07:06 PM
[Course] not('XXX XXX' or 'YYY YYY')

It is giving me a Parsing Error(QE DEF 0260 before or near position 14)
Title: Re: Trying to write an 'is missing' Filter
Post by: MFGF on 07 Jan 2010 12:26:26 PM
Yes - this is not legal syntax.

Try this:

[Course] not in ('XXX','YYY')

Regards,

MF.
Title: Re: Trying to write an 'is missing' Filter
Post by: rob8143 on 07 Jan 2010 12:39:32 PM
Thanks...that worked.  Now... the Report that I want to generate next is one that will show me a list by Employee that does not have XXX or YYY in their entire profile, as opposed to line by line.

Is that possible?
Title: Re: Trying to write an 'is missing' Filter
Post by: MFGF on 08 Jan 2010 05:52:14 AM
Hi,

You could try the following:

Create a list report with Employee number and Course in it, and group by Employee number.

Drag in a Query Calculation from the toolbox (call it Select Flag or something similar) with the following expression:

if ([Course] in ('XXX XXX', 'YYY YYY')) then (1) else (0)

Add a Summary filter with the expression:

total([Select Flag] for [Employee number]) = 0

Make sure you set the scope on the right hand side to be Employee number.

Run the report to make sure you get correct employees listed, then cut (don't delete) the Select Flag column from the list.

MF.