Trying to calculate sum of column values in an add/delete a row table

Avatar

Avatar

ktnewk02

Avatar

ktnewk02

ktnewk02

19-03-2020

I am very new to live cycle and am learning as I go, basically web searching for help and trial and error (lots!).  I am trying to figure out what code to use in each of the 8 columns of a table I have in order to sum each columns' user entered value.  The table has a header row, and then row 1 has subform with a "+" and a "-" button to add and remove the row.  The tabel functions for adding a row and removing a row (even a specific row) are working fine.   I do not need to sum each row.  I need to calculate a sum at the bottom of 8 of the columns, and they are all numeric field objects.  From what I can find, I need to add a Row2 to the table that will be my totals row, but I don't know what to do with each cell for that row for the 8 columns I need to individually calculate the totals for.

Any help is greatly appreciated!

column sum LiveCycle

Accepted Solutions (0)

Answers (3)

Answers (3)

Avatar

Avatar

radzmar

MVP

Total Posts

(val/1000)?string[".0"]}K

Likes

385

Correct Answer

485

Avatar

radzmar

MVP

Total Posts

(val/1000)?string[".0"]}K

Likes

385

Correct Answer

485
radzmar
MVP

21-03-2020

Ok, your repatable row is named "Row1". To calculate the summary of all instances of the field "BottlesOutU" the FormCalc script is as follows.

 

$ = Sum(Row1[*].BottlesOutU)

 

Avatar

Avatar

radzmar

MVP

Total Posts

(val/1000)?string[".0"]}K

Likes

385

Correct Answer

485

Avatar

radzmar

MVP

Total Posts

(val/1000)?string[".0"]}K

Likes

385

Correct Answer

485
radzmar
MVP

20-03-2020

Make sure you've selected FormCalc not JavaScript as scripting language.

 

radzmar_0-1584694087988.png

 

Avatar

Avatar

radzmar

MVP

Total Posts

(val/1000)?string[".0"]}K

Likes

385

Correct Answer

485

Avatar

radzmar

MVP

Total Posts

(val/1000)?string[".0"]}K

Likes

385

Correct Answer

485
radzmar
MVP

19-03-2020

You can use the asterisk accessor to address multiple instances of a repeatable object, such as a table row.

 

Given your row contains a field named "total", you can add a footer row with a calculation script to summarize the values the "total" field in all instances of the row. 

 

$ = Sum(row[*].total)