Get Maximum Value Field

E

erugalatha

Hi,

I have 4 fields on an InfoPath form (e.g. FieldA, FieldB, FieldC and
FieldD).
I wish to add FieldA + FieldB and then FieldA + FieldC and whichever
result is the highest value then I want to put that value into FieldD.

How can I do this?

Thanks for your help.
 
S

S.Y.M. Wong-A-Ton

First you need to decide on a trigger for the calculation. This could be when
the value of the fields change or when a button is clicked. Once you have
this you can add 2 rules on FieldA, FieldB, and FieldC if you decided to
trigger the calculation whenever the value of the fields change, or on the
button if you decided to trigger the calculation whenever a button is
clicked.

Add a first rule with an action "Set a field's value", select "FieldD" as
the field to set, and enter "FieldA+FieldB" as its value. Then add the
following "Condition" to this rule: FieldB is greater than FieldC.

Add a second rule with an action "Set a field's value", select "FieldD" as
the field to set, and enter "FieldA+FieldC" as its value. Then add the
following "Condition" to this rule: FieldC is greater than FieldB.

The only thing left is for you have to decide what to do when FieldA+FieldB
is equal to FieldA+FieldC, since this is not caught by the 2 conditions
specified above.
 
E

erugalatha

Hi,

Thanks for your help.

I ended up using the max() function in FieldD.
e.g. max(FieldB | FieldC) + FieldA
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top