Group:  Other Microsoft Office Products ยป microsoft.public.infopath
Thread: Get Maximum Value Field

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

Get Maximum Value Field
erugalatha[ at ]gmail.com 31.07.2006 14:11:20
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.

RE: Get Maximum Value Field
S.Y.M. Wong-A-Ton 31.07.2006 20:16:02
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.
---
S.Y.M. Wong-A-Ton


"erugalatha[ at ]gmail.com" wrote:

[Quoted Text]
> 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.
>
>
Re: Get Maximum Value Field
erugalatha[ at ]gmail.com 01.08.2006 10:59:41
Hi,

Thanks for your help.

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




S.Y.M. Wong-A-Ton wrote:
[Quoted Text]
> 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.
> ---
> S.Y.M. Wong-A-Ton
>
>
> "erugalatha[ at ]gmail.com" wrote:
>
> > 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.
> >
> >

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net