Calculation in InfoPath

V

Valentina S.

Hi,
I have difficulties to calculate a TOTAL and AVERAGE of column.
This formula that I wrote and checked in PREVIEW, but it doesn't work.
sum(my:group6/my:RiskEntry/my:RPN)

My table looks like this

Prob | Sever | Detec || RPN
this is a numbers that you
enter, and they multiplied -> 5 | 5 | 5 || 125 <-Result
4 | 4 | 4 || 64
... ... ... ...
TOTAL || ?
AVERAGE || ?

In addition, I want to a number to be selected
in colour RED when it's, for example, GREATER THAN 80 AND EQUAL TO 125;
in colour YELLOW - when it's GREATER THAN 48 AND EQUAL TO 79;
in colour GREEN - when it's GREATER THAN 36 AND EQUAL TO 47;
in colour BLUE - when it's LESS THAN OR EQUAL TO 35.

Please help me in this problem.

Thanks a Lot.
Valentina S.
 
J

Josh Bertsch [MSFT]

What exactly do you mean, 'it doesn't work'? Are you seeing any errors?
What version of InfoPath are you using? RTM or SP1 Preview?

From the looks of your XPath you seem to be using an Expression Box.

Try using this for Total:

sum(//my:RPN)

and for Average try (in SP1 there is an AVG() function):
sum(//my:RPM) div count(//my:RPM)

--josh bertsch
 
V

Valentina S.

Hi Josh,
I'm new to InfoPath.
Itried to multiply 3 fields and to got the answer for RPN. When RPN
was in "Expression Box", it does very well, but didn't calculated a
Total and an Average(because they also was an "Expression Boxes".
Now, when I changed the RPN to "Text Box", this box do nothing (I mean
the multiplication), and Total and Average - they are working.

Do I have to write the VBscript code for RPN to multiply 3 fields?
How can I do this?
Thanks for your help.
Valentina S.
 
J

Josh Bertsch [MSFT]

Values from Expression Boxes are not stored. So you can't use a value in an
Expression Box in any other calculation.

The SP1 Preview makes calculations much easier. It is expected to be out in
the very near future.

Here are some useful links:
http://office.microsoft.com/assista...ID=CH010342121033&CTT=6&Origin=HP010426001033

http://msdn.microsoft.com/library/d...ry/en-us/ipsdk/html/ipsdkAboutTheCalcForm.asp

--josh bertsch

Valentina S. said:
Hi Josh,
I'm new to InfoPath.
Itried to multiply 3 fields and to got the answer for RPN. When RPN
was in "Expression Box", it does very well, but didn't calculated a
Total and an Average(because they also was an "Expression Boxes".
Now, when I changed the RPN to "Text Box", this box do nothing (I mean
the multiplication), and Total and Average - they are working.

Do I have to write the VBscript code for RPN to multiply 3 fields?
How can I do this?
Thanks for your help.
Valentina S.


"Josh Bertsch [MSFT]" <[email protected]> wrote in message
What exactly do you mean, 'it doesn't work'? Are you seeing any errors?
What version of InfoPath are you using? RTM or SP1 Preview?

From the looks of your XPath you seem to be using an Expression Box.

Try using this for Total:

sum(//my:RPN)

and for Average try (in SP1 there is an AVG() function):
sum(//my:RPM) div count(//my:RPM)

--josh bertsch
 
Top