Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Claculating Percentages in InfoPath 2003 - NaN Erors

74 views
Skip to first unread message

Pam

unread,
Jan 19, 2009, 12:47:01 PM1/19/09
to
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

Hilary Stoupa

unread,
Jan 19, 2009, 8:22:00 PM1/19/09
to
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


jimr

unread,
May 10, 2010, 9:32:31 PM5/10/10
to
concat((field1 / field2) * 100, "%")

Pa wrote:

Claculating Percentages in InfoPath 2003 - NaN Erors
19-Jan-09

Hi!

Thank you!
--
Pam

Previous Posts In This Thread:

On Monday, January 19, 2009 12:47 PM
Pa wrote:

Claculating Percentages in InfoPath 2003 - NaN Erors
Hi!

Thank you!
--
Pam

On Monday, January 19, 2009 8:22 PM
HilaryStoup wrote:


Submitted via EggHeadCafe - Software Developer Portal of Choice
Parallel Programming in C# 4.0: A Short Synopsis
http://www.eggheadcafe.com/tutorials/aspnet/047afdf6-61ab-4b85-9204-b0f20bdc955a/parallel-programming-in-c.aspx

0 new messages