COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: fatnos on 30 Aug 2007 10:53:09 AM

Title: If parameter is blank...do nothing...
Post by: fatnos on 30 Aug 2007 10:53:09 AM
Hi-

I have a filter that is currently set as follows:

if (?Parameter1? is missing)
then (' ')
else ([Total Vol] < 1)

What am I doing wrong?  All I want to do is have the optional filter fire if the prompt is populated.  If the prompt is not populated I want the filter to be ignored.

Thanks,
Chris
Title: Re: If parameter is blank...do nothing...
Post by: MFGF on 30 Aug 2007 11:44:25 AM
Hi,

I'm guessing you have two filters defined - the first one similar to:
[item] = ?Parameter1?
defined as an optional filter, and the second as in your post.

In your original filter, why not code the expression as follows:

[item] = ?Parameter1? and [Total vol] < 1

leaving it specified as optional.

Just a thought,

MF.

Does that give you what you need?
Title: Re: If parameter is blank...do nothing...
Post by: fatnos on 30 Aug 2007 11:55:48 AM
Thanks for the quick reply.  After some more hunting through Cognos guides I found what I need.

Instead of using (' ') I needed (null)

So now it is coded as:

if (?Parameter1? is missing)
then (null)
else ([Total Vol] < 1)

The prompt is a Yes/No prompt.  The prompt fireds based on whether the user wants to see Total Vol less then 1 or all Volume.

Thanks again,
Chris