Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Complicated ISNULL function Post Reply Post New Topic
Author Message
gemcka
Newbie
Newbie


Joined: 02 Aug 2011
Online Status: Offline
Posts: 16
Quote gemcka Replybullet Topic: Complicated ISNULL function
    Posted: 20 Feb 2017 at 11:16pm
Hi, I'm having trouble writing an ISNULL function to perform an operation in my report.

I'll try to explain what I'm trying to achieve....

In the report I have 3 columns X, Y & Z
X & Y columns are a Sum of a group.

If X is Null then I want to show value -Y in Z
If Y Is NUll then I want to show value X in Z
If there is a value in both X & Y then Z= X-Y

I can get the 1st part working with

If ISNULL (X) then -Y ELSE X-Y

but I can't get the second isnull check to work.

Can you help?
Many Thanks in advance :-)
Gavin


IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 21 Feb 2017 at 2:38am
link your else conditions

If ISNULL (X) then -Y ELSE
If ISNULL (Y) then X ELSE
If NOT ISNULL(X and NOT ISNULL(Y) then X-Y

Although isn't this just using a 0 for null and using x-y for all 3 conditions? If you create one formula as
X-Y and set it to use default values for null it should do the same thing I think.
IP IP Logged
gemcka
Newbie
Newbie


Joined: 02 Aug 2011
Online Status: Offline
Posts: 16
Quote gemcka Replybullet Posted: 21 Feb 2017 at 5:02am
Worked Perfectly! :-)
I didn't realise you could link multiple Else statements.
I'm such a beginner!!

Thanks for your help.
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.020 seconds.