Multiply 2 columns and totaling infopath fields

• Question

• I have a new form. On it I have fields Quantity and price and Total.  These appear 10 times for different items(fields are number 1-10 at the end of the name).  In the totals property I put in a calculation Quantity * Price = Total.

At the bottom of the form in the Properties of SubTotal I add all the totals to a subtotal. In the Properties of Finaltotal I add Subtotal, Tax which is not calculated, and Shipping Charge to Finaltotal.

None of this works.    Do I need to add rules?  Where did this go wrong?

Thanks

William Klein
• Moved by Wednesday, February 9, 2011 9:24 PM InfoPath (From:SharePoint - Setup, Upgrade, Administration and Operation (pre-SharePoint 2010))
Wednesday, February 9, 2011 4:10 PM

• You don't need the "= Subtotal" or the "= Final Total"

In the Subtotal field, right click > properties > click "fx" next to default value.  A formula box comes up, click "Insert field", choose Total1, then enter space and type a plus sign +.  Then enter another space, and click insert field, choose total2.... keep repeating until you get to the last field you want in the total.  Then click the button to check the formula and click ok.

Should look like this:

Total1 + total2 + total3 + Total4 + total5+ total6 + Total7 + total8 + total9

For Quantity and Price, use the same method above, right click Total1 > properties > click "fx" next to default value.  Click to insert a field, choose Quantity1, enter a space and type an asterisk *  then enter another space and click insert field and choose Price1.  Click to verify the formula and click ok.

Should look like:

Quantity1 * Price1

• Proposed as answer by Friday, February 11, 2011 1:33 AM
• Unproposed as answer by Thursday, February 17, 2011 10:15 AM
• Marked as answer by Thursday, February 17, 2011 10:15 AM
Thursday, February 10, 2011 1:31 PM

All replies

• What's not working? The subtotal or the FinalTotal? Is it giving you incorrect value or it doesn't give you any result at all?

Pman
http://www.pmansLab.com/
Thursday, February 10, 2011 1:10 AM
• Could you please post your actual formulas?  That might help determine what the problem is.  Do all of them not work, or do just the calculations in paragraph 2 not work?  You don't need to add rules for this; this should be done in the default value of Total, SubTotal, and FinalTotal.

Aside from your question, I'm wondering why you have 10 of these fields?  From the sounds of it I would think a repeating group with one of each required field would do the trick.  If the user filling out the form always has 10 items to enter you can set your form to always start with 10 rows.

Thursday, February 10, 2011 1:12 AM
• I build a table with 10 rows.  This does not work Quantity * Price = Total1.(nothing happens)

When I sum up total  that does not work. When I add to the Sub total to come up with the final total that does not work.

I want to make sure where to put the calculation?  In the properties of total/subtotal/final totals? what should the calculation look like? anything I

should do special for the properities definition?  I know this should not be so hard and is probably something stupid I'm not seeing.

Total1 + total2+ total3 + Total4 + total5+ total6+Total7 + total8 + total9 + total1= Subtotal

Subtotal + Tax + ShippingCharge = Finaltotal

William Klein
Thursday, February 10, 2011 12:31 PM
• You don't need the "= Subtotal" or the "= Final Total"

In the Subtotal field, right click > properties > click "fx" next to default value.  A formula box comes up, click "Insert field", choose Total1, then enter space and type a plus sign +.  Then enter another space, and click insert field, choose total2.... keep repeating until you get to the last field you want in the total.  Then click the button to check the formula and click ok.

Should look like this:

Total1 + total2 + total3 + Total4 + total5+ total6 + Total7 + total8 + total9

For Quantity and Price, use the same method above, right click Total1 > properties > click "fx" next to default value.  Click to insert a field, choose Quantity1, enter a space and type an asterisk *  then enter another space and click insert field and choose Price1.  Click to verify the formula and click ok.

Should look like:

Quantity1 * Price1

• Proposed as answer by Friday, February 11, 2011 1:33 AM
• Unproposed as answer by Thursday, February 17, 2011 10:15 AM
• Marked as answer by Thursday, February 17, 2011 10:15 AM
Thursday, February 10, 2011 1:31 PM
• Thanks, will try that
William Klein
Thursday, February 10, 2011 2:23 PM
• Brilliant solution!!
Wednesday, August 28, 2019 1:47 PM