Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: can't do summation if the row has null field Post Reply Post New Topic
Author Message
i-dot
Newbie
Newbie
Avatar

Joined: 17 Sep 2009
Location: Malaysia
Online Status: Offline
Posts: 14
Quote i-dot Replybullet Topic: can't do summation if the row has null field
     Posted: 27 Sep 2009 at 6:41pm
hi,
in my report details there is a null field and i would like to calculate all field including null but the result is a blank field. i tried to formulate the null as "0" but it still didn't work out. For example;
field1: null
field2: 2
field3: 5
result for total : blank           (it should get answer as 7)
hope anyone can help because i need to get the result of the calculation.
IP IP Logged
Jyothi Yepuri
Senior Member
Senior Member


Joined: 11 May 2009
Location: Australia
Online Status: Offline
Posts: 127
Quote Jyothi Yepuri Replybullet Posted: 27 Sep 2009 at 6:47pm
is it a Number field?

try this in formula and create summary of this formula
if ISNULL(field1) or field1= "" then 0 else field1

Jyothi
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 28 Sep 2009 at 6:07am
have you tried File/Report Options/Convert DB NULLs to default?  That will probably be easier.  If that doesn't work for you, then you will need to use a formula...or get the data from a stored proc or a view where you can have the DB convert the NULL value to a 0.
 
HTH
IP IP Logged
i-dot
Newbie
Newbie
Avatar

Joined: 17 Sep 2009
Location: Malaysia
Online Status: Offline
Posts: 14
Quote i-dot Replybullet Posted: 28 Sep 2009 at 8:54am
hi..
i'm using "Default Values For Nulls" at option in the formula editor.
it returns to 0 for null and i already can do the summation.
Thank you for ur help.
it is very helpful.


Edited by i-dot - 28 Sep 2009 at 8:55am
IP IP Logged
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