How do I setup the calculation wizard when the numbers I want to calculate are all in one field?

  • bchsindy
    Asked on August 22, 2016 at 10:28 AM

    I have a radio button field with 3 choices. I've set the 'survey' value to 20 on each choice (thinking that is the same as the 'calculation' value).

    When I go to the Calculation wizard,  I cannot figure out how to set the calculation.

    It seems that I need to choose 2 DIFFERENT fields and the function (addition), but my calculation is between choices in the SAME field.

     

  • Support_Management Jotform Support
    Replied on August 22, 2016 at 11:04 AM

    Hello! We can better assist you if we know which form you're working on. I tried my luck with the most recent forms you edited but failed to find a form with a Radio Button field that has 3 choices.

    To give you a more general answer, a Radio Button will only yield 1 selection so when using that field in a calculation, it will only generate 1 value at all times too. You can't perform a calculation in between choices in the SAME field (in this case, the radio button you mentioned). Calculation often requires 2 or more fields to be calculated. Also, what you'll use for calculation would be the Calculation values and not the Options.

    In this example form https://form.jotform.com/62344776012958 I have setup a Radio Button field with (20, 20, 20, 30, 40, and 50) for both the Options and Calculation Values. Then I set up a condition to calculate the sum of 2 fields (radio and textbox). Please clone the form (here's how) so you can see how the Calculation Values and Condition were setup.

    Kindly give us the Form URL/ID on your next reply so we can better understand what you're trying to achieve. And any additional explanation/description about your workflow would be highly appreciated.

    Hoping to hear from you soon.

  • bchsindy
    Replied on August 22, 2016 at 11:11 AM

    Oh, sorry. It was a checkbox field that I was working on, for the Jr High hoops form. Here is a copy.

    I'm just missing some basic trick that I can't figure out.

     

  • David JotForm Support
    Replied on August 22, 2016 at 11:35 AM

    If you want to add up individual selections, you would need to assign those options calculation values.  Here is our guide on how to do so:

    https://www.jotform.com/help/259-How-to-perform-calculation-in-the-form

    Here is a quick example form with calculation values applied to a checkbox field:

    https://form.jotform.com/62344630619960

    Even though it is a single field, the assign values for each option are still added up.

  • bchsindy
    Replied on August 22, 2016 at 12:24 PM

    My instance does not look like your directions.

    Here is my 'checkbox' setup:  I only have the option to add 'survey' values. I don't have an option to add 'calculation values' .

    How do I setup the calculation wizard when the numbers I want to calculate are all in one field? Image 1 Screenshot 30

    So, I added '20', because each session was '$20'. And in the calculation tool, I added the field + the field again. But, the calculations gave me $40 per session.  If I change 'survey' value to '$10', the form does work. Is that what I'm supposed to do? It doesn't seem right to enter a value for each session that is actually 1/2 of the 'true value'.

    How do I setup the calculation wizard when the numbers I want to calculate are all in one field? Image 2 Screenshot 41

  • Support_Management Jotform Support
    Replied on August 22, 2016 at 1:01 PM

    Here is my 'checkbox' setup:  I only have the option to add 'survey' values. I don't have an option to add 'calculation values'.

    How do I setup the calculation wizard when the numbers I want to calculate are all in one field? Image 1 Screenshot 30

    What you're essentially setting up here are the Calculation Values (e.g. the values that will be used on your calculation)

    And sadly, we still fail to understand what your end goal is since you haven't properly explained to us what you're trying to achieve yet.

    From how I see it from my perspective as a user/respondent, I have 4 sessions to choose from (September 25, October 2, October 9, October 16). And you said that each session costs $20 each.

    So if I (as a user) ended up choosing 3 sessions, then I'm expecting to pay $60 for all 3 (and that's how it works on your form right now when I checked it).

    How do I setup the calculation wizard when the numbers I want to calculate are all in one field? Image 2 Screenshot 41

    Is this not the way you want it to happen?

    If you want it to happen differently, please give us more info by explaining to us what/how you want the computation to happen.

  • bchsindy
    Replied on August 22, 2016 at 1:09 PM

    Nice format on the answer.

    Yes, the form is working but ONLY because I have added 10, not 20 to my survey calculation value.

    I only randomly happened upon that solution.  If I set up the checkbox as show in my image, my values are $40 for one camp, $80 for 2, etc.

  • David JotForm Support
    Replied on August 22, 2016 at 1:15 PM

    Each selection will have the values applied to it.  No need to add the field + the field.  For instance, if each session is $20.00, give each selection a value of 20.  In the calculation widget, insert the field only once.  When an option is selected in the field, the value associated with it will be added to the calculation.  If all 4 options are selected, all 4 assigned values will be added to the calculation, even though the field is only added to the calculation once.  The total for all selected values from the field is what will be passed to the calculation. 

    If you have field + field and all 4 options are selected, that means all 4 fields + all 4 fields.  Which is why in your set up, it was doubling the values.

  • bchsindy
    Replied on August 22, 2016 at 1:46 PM

    Ahh, the is the key. If you are using a radio button or checkbox, as long as you choose the field in the calculation setup, the values will be automatically added together. No need to setup up any calculation other than choosing the field. Thanks.

  • David JotForm Support
    Replied on August 22, 2016 at 2:41 PM

    Correct, fields total up all the selections made within them and then pass that total to the calculation field.  If you are only using a single field, no need to add anything further to the calculation.