If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Colour Conditions/Variables for NULL Empty Fields in list report

Started by cbyrne, 14 Jul 2011 07:38:43 AM

Previous topic - Next topic

cbyrne

Hello, i have created a list report but need to create a colour condition on a null field, does anyone know how to do this.  Below is my current variable which doesn't do anything.  I need it to show red when the part number row is empty.



String Variable
CASE [Query1].[Part Number] WHEN ' ' THEN 'RED' ELSE ' ' END


Many Thanks

Chris

CognosPaul

Boolean variable
[Query1].[Part Number] is null

String variable
CASE WHEN [Query1].[Part Number] is null THEN 'RED' END

cbyrne

Thanks PaulM, i have just done something similar and i think it works but i will try your way. Is the below similar to yours?



Data Item = Part Number NULL
coalesce([Query1].[Part Number],' ')


String Variable
CASE [Query1].[Part Number NULL] WHEN ' '  THEN 'RED' ELSE '' END


Thanks


Chris

Lynn

Looks to me like you are using a blank space surrounded by quotes in your original post. This is not the same as null so your string variable would always hit the "else" portion of the clause.

Your last post looks like it would work, but seems to introduce a wee tiny bit of overhead and complexity that you don't really need. Your coalesce transforms null to blank and then allows your string variable expression to work properly.

I think both of Paul's suggestions are a little more straightforward. Since I am somewhat boolean in many aspects of my life I'd opt for a boolean variable instead of string when there are really only two possible outcomes.

cbyrne

Yes thanks Lynn and PaulM, I did seem to complicate it and decided to go with Paul's method.


Many Thanks

Chris