You are viewing limited content. For full access, please sign in.

Question

Question

checkboxes and totals

asked on April 13

Hi,

I am have set up a series of checkboxes where a user clicks for a new phone.  when the phone box is checked a line appears that tells the user the phone cost, monthly fee, cost for a phone case, etc., and a total for the phone. The user can also check a box for other equipment and that line shows fees and totals. like this:

the 

 the numbers are defaulted as they won't change and I can make the total of the item work by using this calculation:

I can't get the grand total to work, and suprisingly (not) AI is of no help. Can someone show me an example of how to get a grand total if one or all boxes are checked? I used single line fields and this is not a table.

I'm in version 11.0.2311.50564

0 0

Answer

SELECTED ANSWER
replied on April 14

Donnie, you will need your calculation to work the checkbox conditions into your calculation then...
 

=SUM( 
   VALUE(IF(EquipmentNeeded.Phone, phone_cost, 0)), 
   VALUE(IF(EquipmentNeeded.Phone, phone_monthly, 0)), 
   VALUE(IF(EquipmentNeeded.Phone, phone_plan, 0)), 
   VALUE(IF(EquipmentNeeded.Phone, phone_case, 0)), 
   VALUE(IF(EquipmentNeeded.Sim, sim_plan_cost, 0)), 
   VALUE(IF(EquipmentNeeded.Ipad, ipad_fee, 0)), 
   VALUE(IF(EquipmentNeeded.Ipad, ipad_plan_cost, 0)), 
   VALUE(IF(EquipmentNeeded.Hotspot, hotspot_fee, 0)),
  )  
   

 

0 0

Replies

replied on April 13

This could depend on how you have your field values set as well as your field rules...

 

I would try updating your field rules to set that the field data is saved when not displayed (to ensure that the fields exist in the form even when not displayed) and update the individual field values to be set with a calculation so that their value is the correct amount when the appropriate checkbox is selected and 0 when the checkbox is not selected, then your sum calculation should work as you're no longer attempting to reference fields which may or may not exist on the form. 

0 0
replied on April 14

Thanks for the reply Will.  I may not have shown the example correctly.  in the example below I check the box for "Ipad" and the correct line and totals show but the grand total shows the total for all equipment needed even though only one item is checked.  I'm trying to find the calculation that will show the grand total of the item checked whether it's one item or all items.

0 0
SELECTED ANSWER
replied on April 14

Donnie, you will need your calculation to work the checkbox conditions into your calculation then...
 

=SUM( 
   VALUE(IF(EquipmentNeeded.Phone, phone_cost, 0)), 
   VALUE(IF(EquipmentNeeded.Phone, phone_monthly, 0)), 
   VALUE(IF(EquipmentNeeded.Phone, phone_plan, 0)), 
   VALUE(IF(EquipmentNeeded.Phone, phone_case, 0)), 
   VALUE(IF(EquipmentNeeded.Sim, sim_plan_cost, 0)), 
   VALUE(IF(EquipmentNeeded.Ipad, ipad_fee, 0)), 
   VALUE(IF(EquipmentNeeded.Ipad, ipad_plan_cost, 0)), 
   VALUE(IF(EquipmentNeeded.Hotspot, hotspot_fee, 0)),
  )  
   

 

0 0
replied on April 14

Will,

That's it! Simple as that!

Thanks so much for your help, I do appreciate it!

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.