Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Calculation of numerical cells

Avatar

Level 2

Hi,

I have created a table in a dynamic form where the user can add or remove rows as required. In the final row which is fixed I want the cells to auto calculate the numbers entered in the cells above. Can this be achieved in LiveCycle Designer?

Many thanks in advance

Lee

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

this is no problem with a small calculation script in FormCalc.

Assumed your repeatable row is named "Row" and contains a field named "Amount" the script will look like:

$ = Sum(Row[*].Amount)

View solution in original post

5 Replies

Avatar

Correct answer by
Level 10

Hi,

this is no problem with a small calculation script in FormCalc.

Assumed your repeatable row is named "Row" and contains a field named "Amount" the script will look like:

$ = Sum(Row[*].Amount)

Avatar

Level 2

Perfect, many thatnks for your help

Avatar

Level 1

Hey radsmar, I have a similar situation.  I am trying to sum the first 9 rows of the "Premium" rows in the table below in the 10th row. The first 9 rows have a binding title of "Premium" and the 10th row has a binding title of "total".  I have put:

form1.#subform[0].Table2.Row10.total::calculate - (FormCalc, client)

$=Sum(Row[*].Premium)

but it doesn't work.  Any ideas?

Table.png

Hierarchy.png

Avatar

Level 7

I do not believe this will work the way you have it. The reason is that you have named the Rows Row1, Row2 etc. If you want to use the sample code then you will have to change the Rows to just "Row" or "Rows". When LCD sees this it will create a unique identifier i.e. Row[0], Row[1].

735807_pastedImage_0.png

Avatar

Level 1

Thank you very much!  That did the trick!

Cheers!