COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: bioCam on 16 Nov 2010 08:38:36 AM

Title: Value Prompt is Null or NOT NULL, set the filter expression
Post by: bioCam on 16 Nov 2010 08:38:36 AM
Hi,  My report has a Value Prompt to select none, one or more Region. 

The original report filter -> [LOCATION_CD] in (?p_region?)  -> this works, no problem.

I modified the filter to -> if (?P_region? is not null ) then ([LOCATION_CD] in ?P_region?) else (0) -> this filter expression fails.

An alternate method is to set the default Value Prompt to (0) then I don't need to modify the original report filter.  Does anyone know why my modified Value Prompt filter expression is not working??  Thank you in advance.


Title: Re: Value Prompt is Null or NOT NULL, set the filter expression
Post by: rockytopmark on 16 Nov 2010 08:48:35 AM
Because (0) isn't a valid filter expression.  Try:

if (?P_region? is not null ) then ([LOCATION_CD] in ?P_region?) else (1 = 1)
Title: Re: Value Prompt is Null or NOT NULL, set the filter expression
Post by: bioCam on 16 Nov 2010 09:47:38 AM
Hi rockytopmark,

Thank you ..your solution if (?P_region? is not null ) then ([LOCATION_CD] in ?P_region?) else (1 = 1) works  :D

I then changed the expression back to if (?P_region? is not null ) then ([LOCATION_CD] in ?P_region?) else (0) and when I validate it, it's not showing me anymore errors   ???

I am using Cognos 8.3 INR version, no patches no far.  Is this a Cognos 8.3 stability issue ???