Looking to have calculation based on total

  • skippboyenga
    Asked on February 2, 2015 at 1:20 PM

    I've looked through the forums but can't seem to find a perfect clone of what I'm trying to accomplish.. I'm building a form that has several products at varying prices.. the totals are simply written in the text area, but it's coded so the total will appear based on quantity. I have the fields talking correctly to the 'total' field (working), but if you fill out more than one of the products, the total field doesn't compile the TOTAL cost - just the last quantity you fill. Is there an easy way to compile the full total based on quantity?  Sample form below:

    http://form.jotform.us/form/50324907341146

     

    Thank you

    Skipp

  • David JotForm Support
    Replied on February 2, 2015 at 2:19 PM

    Hi,

    You would need to use a form calculation widget, rather than just updating a field value.  Here is how I setup the widget to work with your form after I added it:

    Looking to have calculation based on total Image 1 Screenshot 30

    Looking to have calculation based on total Image 2 Screenshot 41

    This will take the quantities entered in your fields, then multiply those quantities by the cost per item.  It will then take those two values and add them to together.  Here is my test form to show you it working:

    http://form.jotformpro.com/form/50325143210942

    Let us know if you have any further questions and we will be happy to help.

  • skippboyenga
    Replied on February 2, 2015 at 3:22 PM

    Thank you for your reply, this helps a bunch. To add more fields then, do I simply add a text box, then the calculations in the total field to tie in the new field? I did try this, and it works (link below), but I'm not able to add the same conditions to that field (your example has the ability to add a 'if book 1 is greater than 0' - I don't get the same option of 'greater than' in my example. I've imported your form from the link above and tweaked it to add a 3rd - can you tell me what I'm missing?

    Your form also seems to calculate MUCH faster than mine.. not sure if that's just on my end.. it goes faster once you fill a few out, but seems like it takes a minute to catch up or something..

    your form: http://form.jotformpro.com/form/50325143210942

    my form: http://form.jotform.us/form/50325518240143

     

    Looking to have calculation based on total Image 1 Screenshot 20

  • David JotForm Support
    Replied on February 2, 2015 at 3:35 PM

    Hi,

    The field I am using is a calculation widget rather than a normal field.  If you see the first screenshot I posted, it shows the widget I am using in my example.  I have the settings set to only do the final calculation after all of the fields in the calculation are entered.  It will not update the final calculation without all 3 fields entered.

    To add additional fields, you are correct.  Add text boxes to your form, then add those fields in with your calculation.  Your current form looks to be set up correctly.  The calculations also load very fast. 

    Are you still having issues getting this working properly?  As far as I can tell you have it set up and working without issue.

  • skippboyenga
    Replied on February 2, 2015 at 3:49 PM

    Ok, thanks. I thought it might be on my end that it was running slowly. The only thing I think is mystery is that on the first 2 inputs you have the option to add the 'if/then' statement with the 'greater than 0' - my 3rd line (the one about 'beginning woodcarving'), when I try to add the same conditional statement, the 'greater than 0' portion is not available. Many other options are, but greater than is not one of them. Maybe I don't need to worry about it, just seems strange I can't add the same statement in the wizard.

    1st 2 fields:

    Looking to have calculation based on total Image 1 Screenshot 30

    New field:

    Looking to have calculation based on total Image 2 Screenshot 41

     

     

  • thrivewellness
    Replied on February 3, 2015 at 9:59 AM

    Perfect! Thank you!

  • thrivewellness
    Replied on February 3, 2015 at 10:01 AM

    That did it! Thanks!

  • David JotForm Support
    Replied on February 3, 2015 at 11:21 AM

    Glad to hear it!  Let us know if there is anything else we can help you with and we will be happy to do so.

  • skippboyenga
    Replied on February 3, 2015 at 5:32 PM

    Sorry David - I would love to have you look at this one more time to see what I'm doing wrong with the FULL, completed form.

    http://form.jotform.us/form/50336481080146

    The same problem is happening as it were in the beginning - it's spitting out the correct totals of ONE of the items, but won't 'grand total' them all together if multiple fields are entered. Can you peek at how I set this up and see what I missed?

    Thanks again -

    -s

  • David JotForm Support
    Replied on February 3, 2015 at 6:25 PM

    Hi,

    I checked your form and you have several conditions overriding your equation:

    Looking to have calculation based on total Image 1 Screenshot 20

    You have a calculation being performed, then a value inserted afterwards in its place.

    After deleting all of your conditions, the form worked as expected:

    http://form.jotformpro.com/form/50337111293951

    Let us know if you have any further questions and we will be happy to help.

  • ellenwoodarts
    Replied on February 3, 2015 at 9:51 PM

    That is awesome. Not sure I completely get it, but amazing that you could help. Thanks so much David!

  • Elton Support Team Lead
    Replied on February 4, 2015 at 2:00 AM

    On behalf of my colleagues, you're welcome.

    Cheers! :)