cancel
Showing results for 
Search instead for 
Did you mean: 

subtracting max value from min value

Former Member
0 Kudos


Hi Experts,

I am just learning Crystal reports 2013 and having problems with a formula to subtract Minimum value from Maximum value at the report footer:

WhilePrintingRecords;

{CDBPoint.Name}= "FLOW_TOT_ABBY"

Maximum ({CDPPoint.Name}) - Minimum (CDPPoint.Name})

I get the Maximum and Minimum values at the report footer using running total fields RTotal0 is Maximum while RTotal1 is Minimum.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Thanks for your help-

It still throws the same error code at the second line {#RTotal0} - {#RTotal1}


abhilash_kumar
Active Contributor
0 Kudos

Please attach the report with saved data ,please.

Or you may send it to my email as well (address is in my profile).

-Abhilash

abhilash_kumar
Active Contributor
0 Kudos

Just change the formula to:

toNumber({#RTotal0}) - tonumber({#RTotal1})

-Abhilash

Former Member
0 Kudos

Now I get an error code:

The current formula cannot be used with the formula expert.

Continuing will delete your existing formula.

abhilash_kumar
Active Contributor
0 Kudos

It works great on the report you sent to me!

I just sent the report back to you.

-Abhilash

Former Member
0 Kudos

It works for me now too-Thanks for your help Abhilash

abhilash_kumar
Active Contributor
0 Kudos

Glad it works. Please close this thread.

-Abhilash

abhilash_kumar
Active Contributor
0 Kudos

Hi Mike,

Since you already have two Running Total fields, how about:

{#RTotal0} - {#RTotal1}


-Abhilash

Former Member
0 Kudos

Thanks for the quick response,

I get a error message:

A number,currency amount,date ,time,or datetime is required here

using that formula

abhilash_kumar
Active Contributor
0 Kudos

What does the Running Total return?

It returns the max and min values (number value) right?

-Abhilash

Former Member
0 Kudos

Yes it does

abhilash_kumar
Active Contributor
0 Kudos

So, when you create a new formula with just this as the code:

{#RTotal0} - {#RTotal1}


you still get an error?


-Abhilash

Former Member
0 Kudos

Yes I have it like that and I get the same error code as before

abhilash_kumar
Active Contributor
0 Kudos

Try:

if isNumeric({#RTotal0}) And isNumeric({#RTotal1}) then

     {#RTotal0} - {#RTotal1}

else

     0


-Abhilash