I'm trying to get all the fields in my PO form to add up to a grand total, however, the tax and shipping boxes appear to be multiplying and I noticed the multiplication increases with each new row I add above. How can I fix this so it adds normally?
Question
Question
Replies
I would suggest using functions instead of javascript to accomplish this as it will be a little easier to maintain and troubleshoot.
For your "Total" column, use a function like this:
=PRODUCT(INDEX(table.quantity,ROW()),INDEX(table.price,ROW()))
Just replace "table.quality" and "table.price" with the appropriate variable references for your table columns.
That will calculate the total for you without the need for javascript.
Then, for the "grand total" do something like
=SUM(table.total,shipping,tax)
Which will sum the "total" column, plus the "shipping" and "tax" fields. Once again, just replace the variables with the ones from your form.
The formula section makes it pretty easy since the ">" opens up a list of all the form variables, including table columns.
Mike,
Can you post your Variable Name of the Table itself, the Quantity Field, and the Unit Price? Also will you post the formula you used in the Total Price Calculation?
Thanks
The tax and shipping are adding appropriately now, however, there is a new problem, the quantity and unit price is not producing the correct total price in the table.
As Evan said, the variable names and actual formula would help. Based on your screenshot, it looks like it is not multiplying the Quanity and Unit Price.
Just to cover all our bases, the Quantity field is a Number type and not a Single Line, correct?
It was single line, I changed it to number and it is working now. Looks like the formula was ignoring it because as a text field.