Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sum on Converted Number Value 1

Status
Not open for further replies.

schief13

Technical User
Jan 21, 2004
26
0
0
US
Using CR 11 Pro, SQL Database

I have a formula that converts the result of one formula to a negative based on a parameter.

if {TRXHISTORYHDR.TRXTYPE}= 3
then -{@Total Amount}
else {@Total Amount}

Once I convert the number to a negative I need to sum the result on the report. The sum function is treating the converted number as a positive number and adding it to the sum instead of subtracting.

Below is the result I am looking for.

Total Amount
1000.00
500.00
-500.00
------------
Sum 1000.00

Thanks in Advance for any help.
 
What is the content of your formula {@Total Amount} (and of any nested formulas)? In what report section are you placing this formula?

-LB
 
The formula {@Total Amount} is a simple addition of the invoice amount plus sales tax and is in the detail section of the report. There are no other formulas in the report. Hopefully I am giving you enough info. I appreciate the response.
 
I am asking for the actual formula.

-LB
 
Sorry,

{TrxHistoryHdr.InvoiceAmt} + {TrxHistoryHdr.SalesTaxAmt}

Thanks
 
Your formula to make the result negative in certain cases should work as is. Make sure you are inserting the sum on the conversion formula and not on {@Total Amount}.

-LB
 
-LB

Thanks for your input. You were correct I found another issue not related to the formula which solved my problem.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top