I have a quantity field in a repeating section. I need to determine the total of that field outside of the section. How do I sum up the quantity of items inside the repeating section in Cognito Forms.
Cognito-forms – How to sum quantities in a repeating section
cognito-forms
Related Topic
- Cognito-forms – Calculations and repeating sections
- Cognito-forms – Custom repeating section in Cognito Forms
- Cognito-forms – Multiple repeating section calculation
- Cognito-forms – Cognito Forms: Referencing a field in a repeating section
- Cognito-forms – How to insert page breaks after each repeating section item in custom document merge templates with Cognito Forms
- Cognito-forms – How to a user eliminate a repeating field
Best Answer
I am a developer with Cognito Forms
The easiest way to total up the quantity across all items in a repeating section is to leverage a calculation field to sum up the total.
For example, if you have a repeating section called "Products" and within each item you have a number field called "Quantity", you can create a calculation field outside of the repeating section. The calculation would simply be
=Products.Sum(Quantity)
. Make sure to set the Type of the calculation field to be "Number" so that the value is formatted correctly.I've included a screen shot a basic form that illustrates this setup.
You can also find this, and other powerful calculations in our help documentation at: http://help.cognitoforms.com/calculations-overview, check out the section on "Working with Repeating Sections".