# How do I calculate negative formula using crystal reports?

How do I calculate negative formula using crystal reports?
###### Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Commented:
What do you mean?

What is the formula?

mlmcc
0
Author Commented:
I have one column of data with positive and negative numbers. I'd like to calcualte them separately using crystal reports.
0
Author Commented:
I'm using one table called drowtran, and MY CODE LOOKS LIKE THIS

{DROWTRAN.td_am_code} = "SR" and
{DROWTRAN.td_amount} >  0.00 and
{DROWTRAN.td_am_code} = "SR" and
{DROWTRAN.td_amount} < 0.00
0
Commented:
You can use a formula like this for the positive values

If ({DROWTRAN.td_amount} >  0.00) then
{DROWTRAN.td_amount}
else
0

ANd this for the negative ones.
If ({DROWTRAN.td_amount} <  0.00) then
{DROWTRAN.td_amount}
else
0

You can then calculate them separately.

mlmcc
0
Author Commented:
I just want to sum all negative numbers and all positive numbers using one field.
0
Commented:
That is the way you do it.  There is no summary capable of choosing just the positive values and then the negative ones.

You could group based on a formula like

If {YourField} > 0 then
1
else
-1

You could then use a group summary

mlmcc
0

Experts Exchange Solution brought to you by