average of radio boxes - non repeating table - InfoPath Dev
in

InfoPath Dev

average of radio boxes - non repeating table

Last post 07-30-2007 10:22 AM by davidair. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 07-30-2007 07:32 AM

    average of radio boxes - non repeating table

    Hi

     I have part of my form which has 6 radio boxes on it (not in a repeating table) and I would like to have a field which will take the average of those 5 boxes - can I do this?

     

    Many thanks

  • 07-30-2007 10:22 AM In reply to

    Re: average of radio boxes - non repeating table

    The avg() built-in InfoPath function takes a nodeset as an argument, that is, an xpath that evaluates to one or more nodes.

    For example, if you have a repeating value /my:myFields/my:group1/my:group2/field1 (where group2 is repeating) then a xdMath:Avg(/my:myFields/my:group1/my:group2/field1) will return the average of values of each instance of group2/field1.

    Your case is not different but you need to construct a nodeset based on your non-repeating nodes. This can be done by using the xpath OR operator |. For example, if your fields are called field1, field2 and field3, the formula to use will be:

    xdMath:Avg(my:field1 | my:field2 | my:field3)

    David Airapetyan / Software Services Architect
    Qdabra® Software / Streamline data gathering to turn process into knowledge
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.