Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: SUM IF ISNULL Post Reply Post New Topic
Author Message
danielr
Newbie
Newbie
Avatar

Joined: 10 Oct 2012
Location: United Kingdom
Online Status: Offline
Posts: 3
Quote danielr Replybullet Topic: SUM IF ISNULL
     Posted: 10 Oct 2012 at 9:56pm
Hi,

I need to do a formula in a report (Crystal Reports 11) which will be like the following. At the moment I have

forumla = SUM ({LineItems}, {AdditionalItems} + {@SharedItems})

But if for example, the user does not put in an additional item, the total field is blank.

Can anyone provide any advice on converting this incorporate an "IIF" and potentially an "ISNULL" statement? I'm using Basic Syntax, but can happily switch to Crystal if needed.
IP IP Logged
Sastry
Moderator
Moderator
Avatar

Joined: 16 Jul 2012
Online Status: Offline
Posts: 537
Quote Sastry Replybullet Posted: 11 Oct 2012 at 2:20am
HI
 
Try this :
 
If isnull({AdditionalItems}) then
formula =  SUM ({LineItems}, 0 + {@SharedItems})
else
forumla = SUM ({LineItems}, {AdditionalItems} + {@SharedItems})


Edited by Sastry - 11 Oct 2012 at 2:21am
Thanks,
Sastry
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 11 Oct 2012 at 3:28am
you can also leave your formula as it is and use the pick list option that is in the formula editor and change it from 'Exceptions For Nulls' to 'Default Values for Nulls'.

Edited by DBlank - 11 Oct 2012 at 3:28am
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