I have a static table (no possibility to add rows) with 5 rows. Each row has a Qty cell with a dropdown list that they can select from or type their own text. I'd like to get the grand total in the bottom footer row.
$.rawValue = Sum(Table2.Row1.Qty.rawValue, Table2.Row2.Qty.rawValue, Table2.Row3.Qty.rawValue, Table2.Row4.Qty.rawValue, Table2.Row5.Qty.rawValue);
Am I missing something? I've tried using "+" signs between the values and removing the "$.rawValue".
Thanks in advance!
The syntax is FormCalc:
this.rawValue = Table2.Row1.Qty.rawValue + Table2.Row2.Qty.rawValue + Table2.Row3.Qty.rawValue + Table2.Row4.Qty.rawValue + Table2.Row5.Qty.rawValue;
Or if you want to swap to FormCalc:
$ = Sum(Table2.Row1.Qty, Table2.Row2.Qty, Table2.Row3.Qty, Table2.Row4.Qty, Table2.Row5.Qty);
See here: http://assure.ly/kUP02y.
Hope that helps,
Thanks so much for that explanation. It really helped.
I'm getting it to sum the numbers now but rather than adding them together (10+20=30) it appears to be concatenating them (10+20= 1,020).
Is there a way to fix this? I checked to be sure it is a numeric field.
Make sure the Qty fields in all of the rows are NumericFields. I suspect that they are TextFields, which means that the data in them will be treated as a string and not a number. Hence the result you are getting.
You can force the script to make the inputs numeric, but it would be much better and easier if the Qty fields were numeric.