Expand my Community achievements bar.

Table calculations: How to get Subtotal of variables???

Avatar

Level 1

Hi there

I am creating a Purchase order form with many (11) columns  so I have no more space to insert  a column which will show the result of "Quantity x Price". (Then it would be simple to get a subtotal at the bottom of that extra column by using Sum function from FormCalc.)

So I would like to have subtotal of the results at the bottom of the table as follows:

ItemQuantityPrice
Row2Cell2Cell3
Row3Cell2Cell3
Row4Cell2Cell3
TOTAL:

The Sum of (Each Cell in Rows [2-20] in "Quantity" column x Each corresponded Cell in Rows [2-20] in "Price" Column )

I am not quite sure if I can use [*] in this case as the first row is a Table Header Row and therefore need's to be bypassed somehow.

please note: the "Total" field in my form is not part of the table as shown above, but a separate numerical field underneath the table.

I don't know Java and will appreciate any help or suggestions if theresi any possibility to do it in FormCalc.

THANK YOU VERY MUCH IN ADVANCE FOR ALL YOUR HELP!

1 Reply

Avatar

Level 10

The easiest way to achieve this is placing the additional column on the right and make it hidden. So that way it will not be displayed to the user.

Place the code in the Calculate event of the hidden column fields to calculate the Quantity * Price.

And at the bottom Sum the all the hidden colum values to display the Total.

If you still have issues, send the form to me I can check it..

Here is a sample file which I did for 6 rows.

https://acrobat.com/#d=Cjy3a9UADCR*g0orWLmEqA

Thanks

Srini