Add totals in repeating table in other field. - InfoPath Dev
in

InfoPath Dev

Add totals in repeating table in other field.

Last post 08-25-2010 11:33 AM by shniggens. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 08-23-2010 03:47 PM

    Add totals in repeating table in other field.

    Hello,

     I am trying to put together a vacation request form that has a repeating table (based off of MS template "absence" request) that has a drop down list with the type of absence (vacation, sick day, etc), and I formatted the start and end dates to total the number of days in a total field.  There is another table (non-repeating) that has the available number of days for each category (per the template) which I pull from a list on my SP site.

     (bear with me)  ; )

     I have the "total" field from the above repeating section populate the "This Request" field in the availability table, which subtracts from the total number of days that were available, and populates the "new balance" field.  I have a rule in the repeating section total that says "if [leave code] is equal to "Vacation", then set fields value [this request] = [total].

     Now, here's the problem I can't wrap my head around.  If someone adds ANOTHER vacation request, it populates the other field with THAT total.  How do I get the sum of all the specific request types?  Keep in mind, there could be various different request types in the same repeating table . . . for instance, 2 vacation days with various requested days, and a couple of floating holiday requests with different date ranges.

     

    I hope that made some kind of sense, and I hope one of you brilliant developers can help me. 

  • 08-23-2010 11:35 PM In reply to

    Re: Add totals in repeating table in other field.

    You might need to do some filtering either when you query the ShP list or after you pull the data down (using a filter when you calc the value in the form).

    Can you attach an image with more details?

    Patrick Halstead
    Project Manager at Qdabra
  • 08-24-2010 12:04 PM In reply to

    Re: Add totals in repeating table in other field.

    Here, I've attached a couple of screenshots that can hopefully help convey what I'm trying to do.  Thanks alot for your time. 

  • 08-24-2010 08:27 PM In reply to

    Re: Add totals in repeating table in other field.

    You can use a formula like:

    sum(/myFields/Absences/Absence[Type = 'Paid Vacation']/Days)

    In each of the cells in that center column.  InfoPath's formula editor can help you set up this filtering.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 08-25-2010 06:13 AM In reply to

    Re: Add totals in repeating table in other field.

    So I should set this formula in the destination field? 

  • 08-25-2010 06:19 AM In reply to

    Re: Add totals in repeating table in other field.

    Yes.  Naturally you will need to adjust it to the actual schema of your form.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 08-25-2010 11:33 AM In reply to

    Re: Add totals in repeating table in other field.

    That's great, and so obvious!  Thanks!

     The only problem I'm having now, if I change the item in the drop down list to say "Sick Leave" it does not recalculate.  It will still be the previous total in "Paid Vacation". 

     Any idea on how to change this behavior?

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