COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: piro299 on 30 Sep 2014 04:07:31 PM

Title: Why does optional filter on prompt page change to required when using data item?
Post by: piro299 on 30 Sep 2014 04:07:31 PM
Hello,

I have a query for my prompt page in which I define a static data item with a value like 'hide value'.

This data item is related to an optional filter on the prompt page. The name parameter in the filter is named prmHideValue

When I use prmHideValue in a second query for a list,

If (?prmHideValue? = '') then ('') else ([Query2].[Data Item1])

the optional filter on the prompt page change to required. Why?

How do I have to use the prmHideValue in the Data Item, so it stays optional?

Many thanks in advance.
Sven

Title: Re: Why does optional filter on prompt page change to required when using data item?
Post by: Lynn on 01 Oct 2014 04:30:49 AM
Whenever you reference a parameter in a data item it has to become required. The expression cannot be validated and the SQL cannot be generated unless there is a value provided, hence it is required. You can give the parameter a default value which won't make it optional but functionally would achieve the same thing.