Expand my Community achievements bar.

Inserting the subtotal at the bottom of the table

Avatar

Level 2
4 Replies

Avatar

Level 1

Any ideas on how to sum a column of numbers? Where you have two rows like this:

NumberOrdered1 Price1 Amount1

NumberOrdered2 Price2 Amount2

Where: NumberOrdered1 * Price1 = Amount1 etc

I want a total at the end of the page that equals Amount1 + Amount2

Avatar

Employee

Hey hellothere111,

As you are working in a Table, you need to provide the complete path e.g(row.fieldname)

in your case please try the script (Formcalc)

Row1.Amount1 + Row2.Amount2

Let me know if it helps.

Avatar

Level 1

Thanks Pranavj. That makes sense, especially with two pages of rows. I tried using Row1.Amount1 + Row2.Amount2 and that still created an 'accessor Row1.Amount1 is unknown' error, so I tried adding in a little more, Table1[1].Row1.Amount1 this stopped the error message but didn't update the total. I also added subform[2].Table1[1].. and #subform[2].Table1[1].. both created an error. Adding a little more, form1.#subform[2].Table1[1].Row1.Amount1 again removed the error but didn't update the total until...  I figured out that the Caption and the FieldName cannot both be "Subtotal". I changed the field name to SubTotal and your advice works great.

Thank you!

Avatar

Employee

Great to know that you are now able to resolve your concern.