How do you calculate totals of one table with the totals of a table within a repeating subform? | Community
Skip to main content
nowackem
Level 5
January 13, 2022
Solved

How do you calculate totals of one table with the totals of a table within a repeating subform?

  • January 13, 2022
  • 2 replies
  • 1118 views

On page 3 of this form, I have two tables and the second one is in a repeatable subform. The goal is to have each of the Amount columns to total at the bottom of each table and then display a grand total in a small third table at the bottom and I have that working. The issue is that if I click the Add Amendment button where I add an instance of the subform, thats when the calculations do not get included into the grand totals. Please see the link to the form below, I have attempted the calculations in the tblTotals table if someone doesnt mind taking a quick look.

https://drive.google.com/drive/folders/1ug_vmOWQMhVu5Px5MTK6GIZmPXSbMuUy?usp=sharing

 

Thank you!

Emilee

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by MHWinter

Try this:

sum(subOriginalDivisionCost.tblOriginalDOC.Row10.totalFedFunds, subAmendment[*].tbleAmendment.Row10.totalFedFunds)

 

(I replaced the "+" by a ",", and removed the "[*]" from non-repeatable items).

It seems to be working on my side.

 

 

2 replies

radzmar
Level 10
January 13, 2022

For a total of a table you can use the [*] accessor to address multiple instances of an object.

 

Sum(ExpandingRow[*].individualTotal)

 

nowackem
nowackemAuthor
Level 5
January 13, 2022

Yes, I understand that part and I have that working in both of the tables. I cant get those total fields in the Amendment table (tbleAmendment) of the repeatable subform to be a part of the grand total calculations. Please check out my link and click the "Add Amendment" button. Then put some numbers in that table and they will not calculate with the rest of the form. 

Thank you for your time, I appreciate it.

MHWinter
MHWinterAccepted solution
Level 4
January 14, 2022

Try this:

sum(subOriginalDivisionCost.tblOriginalDOC.Row10.totalFedFunds, subAmendment[*].tbleAmendment.Row10.totalFedFunds)

 

(I replaced the "+" by a ",", and removed the "[*]" from non-repeatable items).

It seems to be working on my side.

 

 

nowackem
nowackemAuthor
Level 5
January 14, 2022

Perfect! Thank you, I knew it was something simple that I was missing. I tried so many different scenarios but just couldn't get it going. I appreciate you helping me solve this issue.