Search: | |||||

| ||||

Home » Forum » Sharepoint | RSS Feeds |

I have a problem with a form I am submitting from InfoPath to a SP doc library.

The form has yes-no-n/a answers, and I gave yes a value of 1, no as 0, and n/a a

1 as well. The thought process was that n/a answers should not count against the

responder, and I am adding the number of positive responses and dividing by the

number of questions to get a percentage. But the n/a answers inflate the

percentage. Is there a way to check the value of the field, then exclude it from

the calculation? I would also need to decrement the number I am dividing by as

well. This form will have 26 questions, and this is the shortest form I have to

work with. Or is there a better way to do this?

I haven't looked at the functions available, but I'm assuming standard math

functions are available. So here's what I've done in the past in other

systems. Make N/a a value of -1. Then when you want to use it in

calculations you can use the absolute value, which would be 1, but you can

still test the value to tell the difference between yes, no, and N/A.

Another approach would be to make yes (1), No (-1), and N/A (0). Then

simply add the 26 responses. If you get a positive result there were more

yes than no, a negative result more no than yes and the higher the positive

result the more yes answers versus no or n/a.

Yes, but I also need to figure out how many yes answers there are. Maybe I need

to put this calculation in the InfoPath form code.

Ok, I have looked up how to get to form fields and reference in the code

accessed with the "Edit Form Code" button in InfoPath design view. I am checking

the fields, and depending on the value I am calculating a counter variable and a

score variable. The problem is I am getting an error with MainDataSource. The

error is listed below.

Ok, I figured out the problem with the MainDataSource error. One of the language

settings for IP was "C# (InfoPath 2003 Compatible)." So I copied the code to a

text file, removed the code from the form, then changed the setting to C#. Then

I code back in the form. Basically I was trying to refer to something that

IP2003 doesn't know about. And now I get this error.

The name 'NameSpaceManager' does not exist in the current context

Am I again referring to something that IP2007 can't reference?

Didn't find what you were looking for?
Find more on Calculated field
Or get search suggestion and latest updates.

Related Topics:

- Calculated fields (Date Fields)
- Filename field as a calculated field
- Calculate field based on field in another list
- Field is not available in selection box for calculated column
- Calculated Field
- Calculated field based on ID
- Calculate age from date of birth field
- Search in Calculated Fields?
- Calculated Fields Issue - Version Number Disappearing
- More info on calculated fields and filters
- Using list ID in calculated field
- Calculated field for weekday not correct
- Calculated Field Functions
- Calculated Fields and the ID Column
- Group By Calculated Field
- Date Operators for calculated fields in list columns
- Setting the formula of a calculated field using the Object Model
- Infopath conditional logic in calculated field
- Quirk in calculated date fields?
- Syntax for a calculated field in a list?
- Calculated Field Question
- Calculated Field Tip and Trick
- Hiding Calculated Fields for List Items
- Calculated Number Field
- Use of 'Today' in a calculated field