infopath expression

T

Tresha B

I'm using Infopath 2007 to design a survey where people answer questions as to the sevity of an injury by filling in option buttons. Each option has a value, between 1 and 5. My goal is that after someone fills in thier responses, an expression box calculates the scores. The problem is the calculation needs to be made even if the user doesn't answer all the questions.

The formula is: [(sum of responses) -1] / n] where n= the number of completed responses.

I can't figure out how to express this with n bieng an unknown.

Please help.

T


EggHeadCafe - .NET Developer Portal of Choice
http://www.eggheadcafe.com/default.aspx?ref=ng
 
G

Greg Collins

The problem is that you might end up with a divide by zero error if no
responses have been made.

(sum(my:Response) -1) / count(my:Response[. != ''])
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top