Combine the totals of a table in a repeating section and a repeating table - InfoPath Dev
in

InfoPath Dev

Combine the totals of a table in a repeating section and a repeating table

Last post 03-14-2014 04:14 AM by jorow. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 02-06-2014 07:12 AM

    • jorow
    • Not Ranked
    • Joined on 08-26-2013
    • Posts 7

    Combine the totals of a table in a repeating section and a repeating table

    I am looking to combine the sum of totals from a table within a repeating section and a separate repeating table (both are bound to the same datafields) but having an issue where that any total retrieved from the repeating section are added to each expense category row rather than the expense category row that has been selected  - basically when the form is opened a table is presented with several rows containing Expense Categories and their relevant codes. The form itself is for personal expenses so I have another Repeating Table which provides a dropdown selection containing Expense Categories (these are included in the Sharepoint list), so basically what happens is a user will complete rows in the first repeating table selecting the relevant Expense Category and entering an amount which will then update Category row in the second repeating table with a sum of the amount - using this formula - sum(xdXDocument:get-DOM()/my:myFields/my:Expenses/my:ExpenseItems/my:ExpenseAmount[current()/@Category = ../my:ExpenseCategory])  I have now added a new repeating table which has the same Expense Categories etc so I thought adding to the original formula to incorporate this would do the trick - (sum(ExpenseAmount[current()/@Category = ExpenseCategory]) + sum(SterlingValue[current()/@Category = Currency_Category])) - but where the first part of the formula works as expected the second part adds the same total to each of the expense category colums selected i.e. if I add £100 to Subscriptions then the Subscriptions total correctly shows £100 but if I add £100 to Meals then the Subscriptions total would show £200 and the Meals total would show £200.

     

  • 02-10-2014 05:00 PM In reply to

    Re: Combine the totals of a table in a repeating section and a repeating table

    Hi jorow,

    I'm seeing two columns here, one for ExpenseAmount and the other is SterlingValue, but unsure of how everything is set up. Would it be possible for you to attach a copy or a sampe of your form? Or you may send it to me at don.lambatin at qdabra dot com so I could have a clearer idea of what isn't working for you.

    Don Stephen Lambatin / Support Engineer
    Qdabra Software
  • 02-11-2014 03:26 AM In reply to

    • jorow
    • Not Ranked
    • Joined on 08-26-2013
    • Posts 7

    Re: Combine the totals of a table in a repeating section and a repeating table

    Hi Don

    thanks for your reply.  I have emailed you a copy of the form and also some screenshots hopefully showing what the error is.

     

  • 02-12-2014 09:53 AM In reply to

    Re: Combine the totals of a table in a repeating section and a repeating table

    Hi John,

    I sent a reply to  your e-mail. Please check if the solution I sent you works.

    Don Stephen Lambatin / Support Engineer
    Qdabra Software
  • 02-16-2014 02:29 AM In reply to

    Re: Combine the totals of a table in a repeating section and a repeating table

    Hi John,

    Further tests show that there was a bug on the repeating data section which had the formula. Please try recreating another repeating table below and re-enter the formulas for the Finance Use Only section. Hope this fixes the issue.

    Don Stephen Lambatin / Support Engineer
    Qdabra Software
  • 03-14-2014 04:14 AM In reply to

    • jorow
    • Not Ranked
    • Joined on 08-26-2013
    • Posts 7

    Re: Combine the totals of a table in a repeating section and a repeating table

    Hi Don

    Apologies for the delay in replying to you.  I was able to achieve what I was wanting by doing the following:

    In the main data source, move the Currency_Section node to be a child of the ExpenseItems node. This allows the data to have a currency section per expense item, rather than a single currency section covering all expense items

    Create a new ‘regular' table with 3 rows and copy the header and footer from Expenses repeating table into the first and third row in the new table

    Merge cells on the middle row of the new table and insert a repeating section

    Copy the middle/data row from the Expenses repeating table into a new table in the newly created repeating section

    Move the Currency repeating section within the repeating section holding the expense items repeating section

              Updating a binding in the copy controls where necessary and remove the original Expenses repeating table

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