Complicated ISNULL function

Printed From: Crystal Reports Book — Forum Name: Technical Questions

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


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.
Worked Perfectly! :-)
I didn't realise you could link multiple Else statements.
I'm such a beginner!!

Thanks for your help.