Browse Article by Topicsmatrix field form calculation matrix calculation
- How to Perform Form Calculation Using a Widget
- How to Perform Form Calculation in the Matrix Field?
- Calculate Values in the Input Table Through Condition
Related Forum Questions
- How to set up condition between three fields...
- Can't seem to figure out a formula.
- Unable to perform calculation
- Redirect to different URL's based on calculation values
- Which calculation method is more efficient, widget or conditional logic?
- A-Z conditional logic no longer working
- How can I perform a calculation on my form?
- Counting number of dynamic textbox entries
- The Form Calculation Widget caused an incorrectly calculated payment
- Paypal integration not working
How to Perform Form Calculation in the Matrix Field?Last Update: April 9, 2017
It is now possible to use the Matrix field to perform form calculation.
Here in our example, we will set the matrix field similar to a survey questionnaire with ratings or value on them, we will calculate the total rating using the Form Calculation widget. You can follow the steps below on how to do that.
In Version 4.0, we call the Matrix Table from Version 3.0, Input Table. It can be found in the Quick Elements section of the Basic tab when you add Form Elements to the form.
Once you've added the Input Table, select an input type from its properties (cogwheel icon). From the same Fields tab of the Input Table properties, you will be able to set row and column headers.
After constructing the table, you now need to set calculation values for each of its cell (matrix sub-field). To do that, go to the Options tab and enter the values in the provided text area for calculation values following this simple rule, "Separate each column with a comma and each row with a new line."
In the example above, 4 Rows means 4 lines and 4 columns means 4 values separated by a comma.
Note: Choosing a different input type for the table, like a text box or number text box, if you want your respondents to define values for each cell, will not require you to set calculation values.
To get the total value of the selected cell(s) on the table, you will use the Form Calculation widget from the Widgets tab when you add Form Elements to the form.
To perform the calculation, you need to add the input table to the calculation area of the Form Calculation widget.
Clicking the "Add Field" button shown in the screenshot above lets you add fields to the computation.
Adding an Input Table field will let you select which row (radio button) or cell (checkbox field) in the table is to be included in the computation. (This is also referred as matrix sub-fields.)
After selecting the matrix sub-field(s) and clicking Done, you will see the selected sub-fields of the input table in the calculation area of the Form Calculation widget. From there, you will be able to create your own formula to get a total value. The calculation pad on the right will surely help you with the simple to complex mathematical tasks.
Other references that might be helpful:
How to Set Calculation Values For Checkbox and Radio Input Type
If you want user defined values, you can use textbox input type and skip to step 4.
1. Add the matrix field by dragging it in your form.
2. Open the matrix field properties, go to Options tab then enter the calculation values like the following.
3. To get the total, add a Form Calculation widget in your form
4. In the “Calculation window”, click the “Add Field” button to add the fields you want to fetch the value from, in this case it’s the Matrix field.
5. Choose the Matrix Field based from the label you used.
6. Choose what rows you want to fetch the values.
7. You can then use different math functions or values to perform your calculation. In my case, I want to add all the selected radio buttons to have the total score of the survey questionnaire.
You can check the sample form here: http://form.jotformpro.com/form/51691444490963?
Do you have questions about this guide? Please let us know in the comment box below or post it to support forum.