Thanks again for helping with this.
I'm having some trouble understanding your instructions. I've added the
"averageOfAverages" field at the bottom of the form. Your instructions
indicate to add a rule to the "first average field" that sets the value of
the average of averages feild to the average of the 4 average
fields.......this is what has me confused.
Here is my data source structure to see if this helps.
- Ratings1 (Group)
- Org (folder)
- description1 - (field)
- orgRating
- helperField1
- averageOrg
- Ratings2
- Content
- description2
- contentRating
- helperField2
- averageContentRating
- Ratings3
- CommSkills
- description3
- commSkillsRating
- helperField3
- averageCommSkills
- Ratings4
- Quest
- description4
- questRating
- helperField4
- averageQuest
- averageOfAverages
On the bottom of my form I have a table that contains the same fields that
are in the footer of each of the sections; they display all the averages from
each of the 4 sections. I placed the new field, averageOfAverages on the
bottom of that table. When I tried the formula you suggest it did not work
and I got an error that state "the formula contains one or more errors....".
I tried the following formulas (using the information above)
(averageOrg+averageContentRating+averageCommSkills+averageQuest)/4
(orgRating+contentRating+commSkillsRating+questRating)/4
None worked....
I appreciate you looking into this.

Signature
Antonio Machin
Office Automation Analyst 3
Information Technology
Baptist Health South Florida
> Ah... I see you have 4 repeating tables. We can keep it simple in this case,
> since you do not need to use the AVG function to calculate the average of
[quoted text clipped - 61 lines]
> > > > > > fine....I just need that extra step.
> > > > > > http://enterprise-solutions.swits.net/infopath/avg-function-infopath.htm
>When I tried the formula you suggest it did not work
> and I got an error that state "the formula contains one or more errors....".
Did you click on the [Show Details >>] button when you got that error? If
you did, what did it say? And did you use the "Insert Formula" dialog box
along with the [Insert Field or Group...] button when composing the formula?
Or did you just type it in? The only things you need to type in yourself are
the brackets, the plus (+), and the division (/) signs.
You must create 4 rules in total; one on each of the following fields:
- averageOrg
- averageContentRating
- averageCommSkills
- averageQuest
The rule on averageOrg must set the value of averageOfAverages to:
(averageOrg + averageContentRating + averageCommSkills + averageQuest) / 4
If you select the fields using the [Insert Field or Group...] button, your
resulting formula might look something like:
(. + averageContentRating + averageCommSkills + averageQuest) / 4
where ., averageContentRating, averageCommSkills, and averageQuest are
underlined.
If you then check the "Edit XPath (advanced)" checkbox at the bottom of the
"Insert Formula" dialog box, you may get something like
(. + ../../my:Ratings2/my:averageContentRating +
../../my:Ratings3/my:averageCommSkills + ../../my:Ratings4/my:averageQuest)
div 4
The rule on averageContentRating must also set the value of
averageOfAverages to:
(averageOrg + averageContentRating + averageCommSkills + averageQuest) / 4
Again, it may look something like:
(averageOrg + . + averageCommSkills + averageQuest) / 4
when you are done and the "Edit XPath (advanced)" checkbox is NOT checked.
Create the same rule for averageCommSkills and averageQuest.
Why 4 rules? Since you want to update the averageOfAverages field whenever
one of the 4 average fields changes, you need to create 4 rules, one on each
of the changing fields (=average fields).
Just a remark: I would not put the averageOfAverages field under Ratings4,
since it logically does not pertain to Ratings4. A better place to put it
would be under myFields or at least outside of all of the groups. But this
should not affect your calculations.
---
S.Y.M. Wong-A-Ton
> Thanks again for helping with this.
>
[quoted text clipped - 110 lines]
> > > > > > > fine....I just need that extra step.
> > > > > > > http://enterprise-solutions.swits.net/infopath/avg-function-infopath.htm
AntonioR20 - 02 Feb 2006 20:16 GMT
I tried to enter the formula on the averageOrg field and this is the error.
"The expression is not a node-set
-->(.+../my:averageContentRating+../my:averageContentRating+../my:averageCommSkills+../my:averageQuest)<--/4"

Signature
Antonio Machin
Office Automation Analyst 3
Information Technology
Baptist Health South Florida
> >When I tried the formula you suggest it did not work
> > and I got an error that state "the formula contains one or more errors....".
[quoted text clipped - 162 lines]
> > > > > > > > fine....I just need that extra step.
> > > > > > > > http://enterprise-solutions.swits.net/infopath/avg-function-infopath.htm
S.Y.M. Wong-A-Ton - 03 Feb 2006 11:33 GMT
I don't think the paths to the average fields are correct. Did you select the
fields in the "Insert Formula" dialog box using the [Insert Field or
Group...] button? Or did you just type in the entire expression?
When you open the "Insert Formula" dialog box, do the following:
- Type in an opening round bracket ( ( ).
- Click on [Insert Field or Group...] button, select the "averageOrg" field
from the "Select a Field or Group" dialog box, and click on [OK].
- Back in the "Insert Formula" dialog box: enter a <SPACE> and then type in
a plus-sign (+) and a <SPACE>.
- Click on [Insert Field or Group...] button, select the
"averageContentRating" field from the "Select a Field or Group" dialog box,
and click on [OK].
- Back in the "Insert Formula" dialog box: enter a <SPACE> and then type in
a plus-sign (+) and a <SPACE>.
- Click on [Insert Field or Group...] button, select the "averageCommSkills"
field from the "Select a Field or Group" dialog box, and click on [OK].
- Back in the "Insert Formula" dialog box: enter a <SPACE> and then type in
a plus-sign (+) and a <SPACE>.
- Click on [Insert Field or Group...] button, select the "averageQuest"
field from the "Select a Field or Group" dialog box, and click on [OK].
- Type in a closing round bracket ( ) ).
- Enter a <SPACE>.
- Type in a slash ( / ).
- Enter a <SPACE>.
- Type in number 4.
- Close all dialog boxes by clicking on [OK].
I was able to successfully construct a formula as outlined here and in my
previous post using a data source that has the following structure:
- myFields
- Ratings1 (Group)
- Org (Repeating group)
- description1 - (field)
- orgRating
- helperField1
- averageOrg
- Ratings2
- Content
- description2
- contentRating
- helperField2
- averageContentRating
...
- averageOfAverages
If this doesn't work, try constructing the formula one piece at a time: Set
the value of the averageOfAverages field to only 1 field, e.g. the averageOrg
field, in the "Insert Formula" dialog box and see what happens. If this
doesn't work, you will need to look into fixing your data source or fixing
the path to the averageOrg field. Look into the InfoPath help for
instructions. If it works, continue on.
---
S.Y.M. Wong-A-Ton
> I tried to enter the formula on the averageOrg field and this is the error.
>
> "The expression is not a node-set.
> -->(.+../my:averageContentRating+../my:averageContentRating+../my:averageCommSkills+../my:averageQuest)<--/4"
S.Y.M. Wong-A-Ton - 03 Feb 2006 11:39 GMT
Antonio,
In your fourth post you mentioned having a table at the bottom of your form
containing the same average fields that are in the footer of each of the
sections. I'm not quite sure what kind of structure you've set up for these,
but judging from the XPath to the fields in the error message, I'm guessing
that you are creating the rules on the average fields in the "summary" table
at the bottom of the form.
Try creating the rules on the ORIGINAL average fields and see if that works,
since this might be the difference between what you and I are doing.
---
S.Y.M. Wong-A-Ton
> I tried to enter the formula on the averageOrg field and this is the error.
>
[quoted text clipped - 167 lines]
> > > > > > > > > fine....I just need that extra step.
> > > > > > > > > http://enterprise-solutions.swits.net/infopath/avg-function-infopath.htm
S.Y.M. Wong-A-Ton - 03 Feb 2006 11:42 GMT
With ORIGINAL average fields I mean the average fields that are in the footer
of each of the sections.
---
S.Y.M. Wong-A-Ton
> Antonio,
>
[quoted text clipped - 182 lines]
> > > > > > > > > > fine....I just need that extra step.
> > > > > > > > > > http://enterprise-solutions.swits.net/infopath/avg-function-infopath.htm
AntonioR20 - 04 Feb 2006 20:59 GMT
Its working now! I didn't put the space before and after the + sign.
Thank you so much!! :-)

Signature
Antonio Machin
Office Automation Analyst 3
Information Technology
Baptist Health South Florida
> With ORIGINAL average fields I mean the average fields that are in the footer
> of each of the sections.
[quoted text clipped - 187 lines]
> > > > > > > > > > > fine....I just need that extra step.
> > > > > > > > > > > http://enterprise-solutions.swits.net/infopath/avg-function-infopath.htm