Calculating total value based on category variables
I have an app where I am capturing the condition of a home. I want to assign "repair" values to each answer to each question, then sum up based on the answers. i.e.
Category fields -
Roof: Good = 100 Minor Repair = 200 Major Repair = 300 Replace = 1000
Doors: Good = 200 Minor Repair = 400 Major Repair = 600
Exterior Siding: Good = 500 Minor Repair = 1000 Major Repair = 5000
If user picked Roof=Good, Doors=Minor Repair, Exterior Siding=Major Repair my value field will be 5500.
Thanks in advance!!!
-
picture of the category questions:
-
Hi,
you can do it this way in your calculation field:
var roofCat = @roof needs repair; var doorsCat = @doors ...; var exteriorCat = @exterior ...; var roofVal = roofCat == "Good" ? 100 : roofCat == "Minor Repair" ? 200 : roofCat = "Major Repair" ? 300 : roofCat == "Replace" ? 1000 : 0 ; var doorsVal = *(like for roofVal)* var exteriorVal = *(like for roofVal)* roofVal + doorsVal + exteriorVal
Rainer
-
Hi
Did you get anywhere with adding up the totals for this?Heres my code incase anyone can help
var assetReq = @Assets Required;
var assetVal = assetReq == "Hero Banner" ? 1.00 : assetReq == "Skinny Banner" ? 2.00 : assetReq == "Email Design" ? 3.30 : assetReq == "MPU" ? 4.00 : assetReq == "Category Banner" ? 5.00 : 0 ;
assetVal
Thanks -
Rainer,
I have a Category with a multi-select.
Side Wall Mounts ($395)
Thule Pro Bar Roof Rack System ($450)
Rhino-Rack 7' Sunseeker Awning ($299)
Roadshower 4: 7 Gallon ($399)
Roadshower 4s: 4 Gallon ($299)
23ZERO Perrigren 180 Awning ($799)
Front Storage Lockers ($1200)
Rock Sliders ($650)
I need a calculation field to sum the totals based on the selections made. I have a few of these that will need to be calculated in a Grand Total Calculation.
Please sign in to leave a comment.
Comments
8 comments