2 + 2 + 2 = NaN? - InfoPath Dev
in

InfoPath Dev

2 + 2 + 2 = NaN?

Last post 02-09-2011 04:10 PM by witakr. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 02-06-2011 05:44 PM

    2 + 2 + 2 = NaN?

     Hello folks!

     

    Folks, I am having trouble adding a few fields together. I thought if I put all the fields I need to add together in the same Field Group and used the "sum()" function it would work (i.e. "sum(FieldGroup)") but when I click the button all it says is "NaN"

     

    Would someone please help me figure out what I am doing wrong or if there is a better way to calculate the sum of three fields and display the total in a 4th field?

     

    Thanks so much!

     

    Jay

     

     

  • 02-06-2011 09:29 PM In reply to

    Is this a repeating, or non-repeating group?  It looks like you asked this same question a week ago and ignored my response.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 02-06-2011 09:44 PM In reply to

    I'm sorry I didn't mean to ignore you. I can't remember where I posted that question..sorry I don't think it its a repeating group . How do I tell if it is?
  • 02-06-2011 10:22 PM In reply to

    If it's repeating, it would have a little blue icon with a down arrow on it in the data source taskpane.

    sum() requires you to specify the specific nodes to sum.  It is not intended for summing all the children of a group.  If you just want to add together three fields, you're probably best off just adding them together and not using the sum() function:

    USCurrency + USCoinage + Checks

    Here's your previous thread:

    Getting the sum of multiple fields

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 02-06-2011 11:29 PM In reply to

     In that case, no, its not a repeating group of fields.

     

    So I should just type the field names in that format in the function dialog or in the code editor for the button used to perform the action?

  • 02-07-2011 06:35 AM In reply to

    In the Function Editor dialog.  You should use the Select Field... button to select each of the fields, and put plus signs between them.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 02-09-2011 04:10 PM In reply to

     That worked perfectly. Thank you for your help.

    Again I apologize for ignoring your first attempt to help me. It was not my intention.

     

    Thank you so much for your help. This and one other problem I have have been bothering me for  days now. Thank you.

     

    Jay

Page 1 of 1 (7 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.