 Level 1

0% to Level 2

Tip /

to gain points, level up, and earn exciting badges like the new
Mission!

View all

## FormCalc conditional sum problem jparris67
Level 1

Likes

0 likes

Total Posts

6 posts

0 solutions
View profile

jparris67
Level 1

Likes

0 likes

Total Posts

6 posts

0 solutions
View profile
jparris67 Level 1

18-12-2019

I have a travel reimbursement form with numeric fields for all expenses and cash advances. I have two fields for totals: one for "Amount Due Traveler" and one for "Amount Due University." I need for the Total Expenses and Advances fields to be compared, and if Expenses are greater than Advances, the Amount Due Traveler should sum and leave the other field at \$0. If the opposite is true, the Amount Due University should sum and leave the other field at \$0.

I've tried different if then else statements and nothing seems to be working. I've done a lot of research and can't seem to find the answer.

What would be the proper way to write this in FormCalc?

FormCalc

#### Accepted Solutions (1) Magus069
MVP

Likes

143 likes

Total Posts

1,072 posts

155 solutions
View profile

Magus069
MVP

Likes

143 likes

Total Posts

1,072 posts

155 solutions
View profile
Magus069 MVP

18-12-2019

Hi there,

I can't directly give you the solution at hand without the object references. Without the hierarchy, all I can give you is the syntax on how to make this work.

So technically, you need a calculate event for each fields which you need to input a calculated value or 0\$, both will have the same syntax, but different outcome.

For the Amount Due Traveler it should look something like the following:

``````Amount Due Traveler :: calculate - FormCalc

;Calculate Amount Due Traveler
else
0
endif``````

and For the Amount Due University, it's simply the opposite

``````Amount Due University :: calculate - FormCalc

0
else
;Calculate Amount Due University
endif``````

You can always provide a screenshot with the hierarchy and the code you are testing if you need any more assistance.

You can always refer to the FormCalc User Reference for any question on how to use the language

I hope this will help. Oh my gosh, thank you! I'd tried everything, but making some adjustments, this is what worked:

Total due traveler:

else 0
endif

Total due university: