Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: dealing with nulls when adding columns Post Reply Post New Topic
Author Message
dwool
Newbie
Newbie


Joined: 24 Apr 2008
Online Status: Offline
Posts: 1
Quote dwool Replybullet Topic: dealing with nulls when adding columns
    Posted: 24 Apr 2008 at 1:13pm
Hello, I am very new to crystal reports and have problem you can help me solve.

I have a data set that contains null values and when the columns are added together no total is summed because of the null value.

You can see below the five columns that are being added together. The last column is the one that sometimes contains a null. When it does contain a null the total for that particular row is not summed up using the formula below. My question is how do I replace the null with zero so a total can be summed. I would rather change the report then change the stored proc in the database that is gathering the data.

You can see I made an attempt to deal with the null in the last column, I found this on this forum. Unfortunately this does not seem to work. Any thoughts on how I can deal with this?

{USP_RptTotalOrders;1.mail_orders}+
{USP_RptTotalOrders;1.webmacs_orders}+
{USP_RptTotalOrders;1.tapemacs_orders}+
{USP_RptTotalOrders;1.phone_orders}+
IIF(IsNull({USP_RptTotalOrders;1.corporate_orders}), 0, {USP_RptTotalOrders;1.corporate_orders})

IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 24 Apr 2008 at 6:36pm
I'm not sure why the last statement doesn't work b/c that is what I would do. But an easier way to handle this is to go to the menu options File > Options > Reporting tab. Click the NULL checkboxes so that nulls are converted to zero (or an empty string).

I cover how to handle nulls in your formulas in Chapter 6 of my Encyclopedia book. You can find out more about my books at Amazon.com or reading the Crystal Reports eBooks online.
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.047 seconds.