COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: gatorfe on 03 Dec 2013 11:24:12 AM

Title: Adding a null value
Post by: gatorfe on 03 Dec 2013 11:24:12 AM
We are tyring to add 2 values on a report.  One value sometimes comes in as null.  When it does the total shows as null too.  How can we make the total show the value that is not null.  Attached is a pic.  Thanks in advance for any suggestions.
Title: Re: Adding a null value
Post by: bdbits on 03 Dec 2013 11:49:37 AM
Change the data item expression with the potentially null value to something like:
   if ([some_value] is null) then (0) else ([some_value])
Title: Re: Adding a null value
Post by: Lynn on 03 Dec 2013 11:55:41 AM
another option:

coalesce ( [some_value], 0 )

However your sample shows the proper total for one of the columns but not the other. Might be worth looking at the difference between those two items to see if there is something odd going on.
Title: Re: Adding a null value
Post by: adam_mc on 03 Dec 2013 02:53:00 PM
Yet another option:

Format the cells to have the value you wish..
First Select Cells,
Then Properties > Data > Data Format > Select Format Required > Set "Missing Value Characters" to value you wish to display instead of Null.