Office - Claculating Percentages in InfoPath 2003 - NaN Erors

Asked By Pa on 19-Jan-09 12:47 PM
Hi!

I am attempting to calculate a percentage off of 2 fields into a third
field. I have defaulted Fields 1 & 2 to zero. Field 3 defaults to:

round(Field 2 / Field 1 * 100)

I am formatting Field 3 as a whole number - the decimal as a percentage
option does not seem to calculate if I use it.

I have a Rule where if Field 1 = 0, then set Field 3 to zero. This works the
first time I publish and open a new form. After that, the form seems to
ignore the rule and produce NaN errors on every one of the calculated fields.
Why? How do I make the rule apply each time? Is there a way to default using
an If/Then type of statement for the default instead?

Thank you!
--
Pam


HilaryStoup replied on 19-Jan-09 08:22 PM
Rules are fired when the value of a field changes, so if the field that your
rule is based on doesn't change, the rule won't fire. If it is an open rule,
it will fire when the form opens.

I use the second method mentioned in this post a lot for conditional default
values:
http://blogs.msdn.com/infopath/archive/2006/11/27/conditional-default-values.aspx


--
Hilary Stoupa
Visit InfoPathDev at http://www.infopathdev.com
Jim R replied to Pa on 10-May-10 09:32 PM
concat((field1 / field2) * 100, "%")