0

I created a form in InfoPath, in which current Year information is compared in a calculated value to Previous Year. Each Year is in a different list, so to calculate the variance percentage I did something like this:

 translate(CurrentYearField1 * 100 / PreviousYearField1 - 100, "aINnfity", "00")

This calculation was causing a postback, showing a "Sending information to the server" message every time a field is modified. The "translate" and "aINnfity" are only to avoid the "NaN" or "Infinity" instead of the real information. If I remove them, leaving the calculated field like this:

CurrentYearF1 * 100 / PreviousYearF1 - 100

There is no postback, but I get "NaN" or "Infinity" if any of the fields is 0. Disabling postback in the "Browser Forms" options stops the postback from happening, but it doesn't update the calculated value when one of the fields is modified.

Is there anyway to avoid the postback and the "NaN" at the same time?

Regards!

1 Answer 1

0

Maybe try doing it with an action, something along the lines of:

    If CurrentYearField1 is not blank and PreviousYearField1 is not blank
    Set field value: Your calculated field equals expression: 
translate(CurrentYearField1 * 100 / PreviousYearField1 - 100, "aINnfity", "00")
1
  • I don't know of a way to have an If in a calculated value. but I'm not sure I understand your answer.
    – varrtto
    Apr 28, 2014 at 17:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.