Repeating Table, want to sum current row based on other values. - InfoPath Dev
in

InfoPath Dev

Repeating Table, want to sum current row based on other values.

Last post 10-01-2015 07:50 AM by Hilary Stoupa. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 10-01-2015 07:38 AM

    Repeating Table, want to sum current row based on other values.

    Hello, I have a repeating table where I want to calculate a sum, based on a few criteria. In the image I have uploaded, the user selects the Location, and then populates a financial Hierarchy and Band (job level). Based on those criteria, I have a formula as the default value that queries a SharePoint list of HR data, matches the variables the user has populated in each line of the repeating table to the data and outputs a sum. I have this working but as I add rows descending, I find that the formula outputs the same sum regardless of the difference in variables on each row of the repeating table. I understand I need to somehow incorporate CURRENT into my formula but I can not! The formula is currently populated as: sum(xdXDocument:GetDOM("Staffing Report")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Opens[../d:Band_x0020_ = xdXDocument:get-DOM()/my:myFields/my:Group/my:RepeatingFields/my:Band and ../d:Work_x0020_City = xdXDocument:get-DOM()/my:myFields/my:LocationDropdown and ../d:_x0033__x002d_Dot_x0020_Hierarch = xdXDocument:get-DOM()/my:myFields/my:Group/my:RepeatingFields/my:Hierarchy]) Where can I incorporate 'current()/' so that the sum is calculated properly for each row? Thank you!
  • 10-01-2015 07:50 AM In reply to

    Re: Repeating Table, want to sum current row based on other values.

    So - this is a default value in a field inside the repeating table?

    If so:

    sum(xdXDocument:GetDOM("Staffing Report")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Opens[../d:Band_x0020_ =current()/../my:Band and ../d:Work_x0020_City = xdXDocument:get-DOM()/my:myFields/my:LocationDropdown and ../d:_x0033__x002d_Dot_x0020_Hierarch = current()/../my:Hierarchy])

    If that doesn't do it, you can attach a copy of your form under the Options tab in a reply and I can give you a hand. 

    Hilary Stoupa

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