Answered

Calculation in Results Page

  • 15 March 2024
  • 5 replies
  • 27 views

Hi everyone, I’m trying to build out a quiz that asks for a number (annual cost) and service (multiple choice). Each option on the multiple choice is tied to a percentage and the results page should display the final calculation of Annual Cost * Service Percentage. Is there a way to set up logic that will display that amount? Thank you in advance for the assistance!

icon

Best answer by john.desborough 15 March 2024, 18:21

View original

5 replies

Userlevel 7
Badge +5

Hi @shoon Thanks for stopping by the community! I believe you would need to add one of these numbers into a variable in order to multiply them both at the end - @john.desborough is that correct? Or am I doing my math wrong. 🤣

Userlevel 7
Badge +6

@Liz - correct 

  • create a variable say v_total
  • logic rules
    • if annual cost is greater than 0 add annual cost to v_total
    • if mc is A then multiply v_total by value for A 
    • if mc is B then multiply v_total by value for B

note that since you can’t have a decimal value in the for “value of A”, etc. you would then have to divide the v_total by 100 to make it work out.. ie 1000 x 40 / 100 is the way to calculate 1000 * .4

 

des

Thank you @Liz and @john.desborough for your responses and advice! What I ended up doing on the logic:

Enter annual cost (number field)

Select Service (multiple choice option)

If Service is A, then multiply variable @total_savings by a decimal value tied to the service. 

 

Userlevel 7
Badge +6

well done @shoon .. glad that helped

Userlevel 7
Badge +5

Oh lovely! Glad to hear that worked, @shoon , and thanks @john.desborough for the help! Let us know if you have any other questions, @shoon . 😀

Reply