Calculating subtotals/page totals | Adobe Higher Education
Skip to main content
Level 3
November 9, 2018
Respondido

Calculating subtotals/page totals

  • November 9, 2018
  • 15 respostas
  • 17788 Visualizações

Hello;

I'm trying to calculate row subtotals and a page total within a repeating table (see below).

What code should I be using for the Total Value column to total each row and then the Page Total row at the bottom to add up all of the rows in the Total Value column? I know the easiest way is with FormCalc but everything I've tried has duplicated the values from the previous row to the new row when the Add '+' button is clicked.

I appreciate your help.

Este tópico foi fechado para respostas.
Melhor resposta por radzmar

Well, the total value per row should be calculated with:

$ = Quantity * Value

And the page total with:

$ = Sum(Row1[*].TotalValue)

Both scripts are in FormCalc not JavaScript!

15 Respostas

_Bruce_Robertson
Level 10
November 14, 2018

Hi,

Have a look at this version

https://sites.google.com/site/livecycledesignercookbooks/home/loanrequest_111318a.updated.pdf?attredirects=0&d=1

The row total calculation expression needs to be "$ = Quantity * Value" ... which is what radzmar suggested.

Regards

Bruce

Level 3
November 14, 2018

Thanks radzmar​ and BR001​! Works perfectly now.

So quick question; when is it ideal to have the rest of the path in the expression? I think I do it absentmindedly but clearly there are times when an absolute path isn't necessary.

Thanks again!!

_Bruce_Robertson
Level 10
November 15, 2018

Hi,

I would use the shortest path possible, I also use the script editor to insert the path for me.

1) Ensure that the Script field of the Script Editor has the focus and the cursor is positioned where you want to insert the object reference.

2) Hold down the Ctrl key and on your form design view, click the object you want to reference. The cursor pointer changes to a 'V' when you when you are over a valid object.

If you did want an absolute path then you can use Shift-Ctrl-Click to insert a reference.

Bruce

Level 3
November 15, 2018

Thanks for the insight, BR001​.

I appreciate all your help.

Level 3
January 17, 2019

Another quick question regarding this solution;

Is it possible, since this table contains repeating table rows that might extend across multiple pages, to have the footer row of each additional page sub-total all of the calculations for that particular page - not just the total of all calculations going on in the form (if that makes any sense)? So if the footer row is on the final page, it totals everything but if it extends to another page, the footer row for that page only calculates that page's sub-totals.

I appreciate the help.