These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Subtraction calculation

mwiebe
Registered: Jan 26 2007
Posts: 2

I create a lot of interactive forms using sum(+) calculations and picking appropriate fields. In form I am now working on I need calculation to subtract one field from another and not finding a way to make this work. Is there a simple way to do this?

My Product Information:
Acrobat Pro 7, Macintosh
Dimitri
Expert
Registered: Nov 1 2005
Posts: 1389
Hi mwiebe,

Sure, you can use "Simplified Field Notation"- the next option down from the "Value is the" used for the sum (+) calcs.
Check the Simplfied Field Notation radio button, click Edit and enter for example Text1-Text2 ( substitute with your actual field names).

For more on calculations in Acrobat you may want to take a look at this article on the JavaScript Corner-

[url=http://www.acrobatusers.com/tech_corners/javascript_corner/tips/2006/form_calculations/]http://www.acrobatusers.com/tech_corners/javascript_corner/tips/2006/form_calculations/[/url]

Hope that helps,

Dimitri Munkirs
WindJack Solutions
[url=http://www.windjack.com]www.windjack.com[/url]
dpierce
Registered: Aug 4 2009
Posts: 11
I tried the simple calculation of field 1 - field 2 and it did not work. Any input?
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4307
Did you receive any messages?

What are the field names?

What is your script?

Are you performing any other calculations?

See [url=http://www.acrobatusers.com/tutorials/2006/form_calculations]How to do (not so simple) form calculations[/url] by Thom Parker for more information.

George Kaiser

dpierce
Registered: Aug 4 2009
Posts: 11
It didn't return an answer.

This is what I put in the simple field notation. This is the field names.

TOTAL_ACTUAL_EXPENSESRow1-TOTAL_PRIOR_TRIP_PAYMENTSRow1

Each of these fields have their own calculation which works.
dpierce
Registered: Aug 4 2009
Posts: 11
I got it work. Not sure what I did different.
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4307
It might be the calculation order for the fields.

George Kaiser

novwilliams
Registered: Jan 13 2010
Posts: 2
i'm trying to subtract "expenses" from "income" using this calculation in adobe 9:
"gross_income"-"x9" (" represents actual field name) and nothing seems to work. Please help
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4307
Are you getting any error messages?

Open the JavaScript console, + J.Where are you placing your code?

You do not use quotation marks in the 'Simplified field notation' option. The quotation marks in that field indicate a character string value and not a variable name.
gross_income - x9

George Kaiser

novwilliams
Registered: Jan 13 2010
Posts: 2
I'm not getting any error messages and i am entering in the simplified field notation just as you have it but no result.
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4307
Here is a simple [url=https://acrobat.com/#d=x7NtMJg3u53lEO9Efrk8Hw]Simple Income Statement[/url] using those field names and the simplified field notation.

George Kaiser