Sum values from a different repeating table - InfoPath Dev

InfoPath Dev

Use our Google Custom Search for best site search results.

Sum values from a different repeating table

Last post 10-30-2014 11:17 AM by mattpalmgren. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 10-30-2014 01:51 AM

    Sum values from a different repeating table

    I have 2 repeating tables. Table 1 lists Employees and their Payrate. Table 2 has a dropdown field called Name that gets its values from the Employee field in table 1, a text field called Task, a Rate field that looks up the employee's payrate, a number field called Hours, and a Cost field that multiplies Rate by Hours.

    Table 1 looks like this:

    Employee       Payrate
    John                50
    Jane                75
    Mark                35

    Table 2 looks like this:

    Name       Task                       Rate      Hours      Cost
    Jane         Design the form      75          4              300
    Jane         Test the fields         75          1                75
    John         Review the form     50           3              150
    Jane         Publish the form      75          1                75

    I would like to list the total number of hours of tasks for each employee in another table.  So I copied Table 1, placed it further down the form, and removed the Payrate field, leaving just a list of the Employee Names.  I tried creating another field in Table 1 called Hours Tasked, but I cant figure out a way to total the hours for each user.  I tried to use this formula

    sum(Hours[Name=Employee])       I have also tried reversing Name and Employee

    Yhis is the result I get:

    Name       Hours Tasked
    John         9
    Jane         9
    Mark         9

    I would like the table to look like this: 

     Name       Hours Tasked
    John         3
    Jane         6
    Mark         0

  • 10-30-2014 10:02 AM In reply to

    Re: Sum values from a different repeating table

    Your approach should work - I'm guessing it is just something in your XPath filter. If you open up the formula editor for the sum formula and click the checkbox to display the XPath, what is the XPath?

    Hilary Stoupa

  • 10-30-2014 11:17 AM In reply to

    Re: Sum values from a different repeating table

    Thanks Hilary. I re-created the form this morning, and somehow it is working the way I expect. I must have just been up too late when I was trying it last night! :)
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.