NaN error when summing the results of multiple expression boxes - InfoPath Dev
in

InfoPath Dev

NaN error when summing the results of multiple expression boxes

Last post 07-23-2010 05:06 PM by Jimmy. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 07-23-2010 03:03 PM

    NaN error when summing the results of multiple expression boxes

    Ok, I'm a real newbie.  I'm converting a time sheet from paper to an infopath form.  I have columns marked 1-15 (first 15 days of the month), and rows for activities.  So for example, I have a row for work, one for vacation, one for sick days, one for holidays, etc.  I've put the 15 day fields in each row into a group, and an expression box in the last column of each row sums the 15 fields for that group.

     I have each of the 15 fields set as an integer, with a default value of zero, (although I've tried setting them as text strings too).  The expression box in the last column in each row) contains this formula: field24 + field25 + field26 + field27 + field28 + field29 + field30 + field31 + field32 + field33 + field34 + field35 + field36 + field37 + field38, and accurately totals the fields.  The result is formatted as a whole number.

     But when I try to come up with a grand total of the various activities, Infopath returns NaN.  I'm trying to do this with another expression box with this formula:  sum(work | Holiday | Vacation), for example (I've tried several variations of these, but everything I try returns NaN).  I'm sure I could simply sum every one of the fields involved, but that seems pretty cumbersome.

    The other method I tried was to total each day's time, and then total the time for all 15 days.  Same result.  I can't seem to find a way to get the program to add the results of two expression boxes together.

     This is my first attempt at Infopath - I've worked with formlas in Word and excel, but I can't seem to solve this one.  What am I doing wrong?

     Thanks -

    Tom Donovan

  • 07-23-2010 03:56 PM In reply to

    Re: NaN error when summing the results of multiple expression boxes

    Hi Tom,

    At first glance it seems like a potential data type mismatch on one of the fields?  Did you check each field to make sure you don't have a data type issue?

    If you post the template I can take a look.

    Ted

  • 07-23-2010 05:06 PM In reply to

    Re: NaN error when summing the results of multiple expression boxes

    Are the work, Holiday, and Vacation fields themselves numeric, or do they have child fields that are numeric?  If it's the latter, then that formula is not going to work.

    I think a screenshot of your data source, indicating which fields you want to sum, would help a lot.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.