How to Calculate the Total Based on the Quantity Entered in Input Table?

  • karenlanter
    Asked on June 19, 2024 at 7:30 PM

    I am trying to create a form to track home medical equipment donations by type, quantity and weight. It is not multiplying and totaling the way it needs to. I have watched a number of videos and believe i am close.


    https://form.jotform.com/241706525501045


    is what it looks like. Each item we collect has a weight associated with it. I would also like to add cost per unit, but that is for another day. Say someone donates five manual wheelchairs and three rollators, we need a total weight. How do I add these subtotals and then get a grant total for weights. I really need your help. Thanks,


    Karen

  • Marehlene_B JotForm Support
    Replied on June 19, 2024 at 8:19 PM

    Hi Karen,

    Thanks for reaching out to Jotform Support. I understand what you’d like to do, but I’ll need a bit of time to work out a solution. I’ll get back to you shortly.

    Thanks for your patience and understanding, we appreciate it. 

  • Marehlene_B JotForm Support
    Replied on June 21, 2024 at 5:15 PM

    Hi Karen,

    I found a workaround that may be suitable for what you are looking for. We simply need to duplicate the input table and add conditional logic in which we enter the weight of the item in the condition and send the result into the item's associated row, and then use the Form Calculation widget to calculate the sum of all the items in the input table. Let me show you how:

    • Right-click the Input Table and select Duplicate. Then, make sure to give the field a distinctive name so it can be easily identified, and Hide it so it is not displayed in the form. 

    How to Calculate the Total Based on the Quantity Entered in Input Table? Image 1 Screenshot 70

    • Set up an Update/Calculate field condition. Check out the screencast below to see how it's done with the Bed item in the input table. 

    How to Calculate the Total Based on the Quantity Entered in Input Table? Image 2 Screenshot 81

    • Here's how the conditional logic will look like.

    How to Calculate the Total Based on the Quantity Entered in Input Table? Image 3 Screenshot 92
    Simply repeat the same condition with other fields in the input table, enter the item's weight multiplied by the item in the displayed table, and select the hidden input table to the summary. 

    The next step is to remove the fields from the Form Calculation widget and replace them with the hidden input table fields. 

    • Select your Total's wand icon and delete all of the fields in the widget. Then, click the Add Field button again, but this time you must select the fields from the hidden input table and include a plus sign between them. 

    How to Calculate the Total Based on the Quantity Entered in Input Table? Image 4 Screenshot 103

    How to Calculate the Total Based on the Quantity Entered in Input Table? Image 5 Screenshot 114Take a look at the screencast below to see my results. I only get the calculation value you specified in the table, with the bed at 300 and the Bedside Alarm/Rails/Topper at 12. 

    How to Calculate the Total Based on the Quantity Entered in Input Table? Image 6 Screenshot 125
    We also have a guide about How to Insert Text or Calculation Into a Field Conditionally that you can check out.

    Give it a try and let us know if you have any other questions.

  • karenlanter
    Replied on June 21, 2024 at 5:55 PM
    Exciting and wonderful. I will implement tomorrow. Thanks.
    Karen Lanter, MPA, CFRE, CAP
    Executive Director
    St. Louis Health Equipment Lending Program (STLHELP)
    9709 Dielman Rock Island Industrial Drive
    St. Louis, MO 63132
    karenlanter@stlhelp.org<karenlanter>
    c. 618.530.4312
    o. 314.897.4357 (HELP), ext. 4
    ________________________________
    </karenlanter>...
 
Your Answer