Regarding the Yes or No Button

  • toclimateres
    Asked on November 15, 2016 at 5:03 PM

    Scenario:

    X is a drop down menu with 9 different options.

    Y is a YES or NO Button. If Y=YES, then Y = 0; if Y=NO, then Y will take a some value based on the 9 different options of X. 

    Question:

    I just want to make sure there is no way to get around using 9 DIFFERENT if-statements for scenario, meaning that I can not combine them into 1 if-statement. I am asking because I want to have maybe 10 different YES or NO Buttons, which means I will probably end up with 90 different if-statements.

     

    Regards,
    Jacob

  • David JotForm Support Manager
    Replied on November 15, 2016 at 6:36 PM

    Not sure if I understood what you mean, but here is my example based on the logic you have provided:

    1) If you have a drop down field with 9 options, assign a value to each option: https://www.jotform.com/help/301-How-to-Assign-Calculation-Value 

    Regarding the Yes or No Button Image 1 Screenshot 60

    2) Then I guess you will be using a radio button for the "yes or no" question.

    Regarding the Yes or No Button Image 2 Screenshot 71

    3) To obtain the result add a Form Calculation field:

    Regarding the Yes or No Button Image 3 Screenshot 82

    4) Create the following conditions:

    Regarding the Yes or No Button Image 4 Screenshot 93

    Result: https://form.jotform.com/63196600180956 

    Regarding the Yes or No Button Image 5 Screenshot 104

    So, I believe it will only take two conditions based on the scenario you described. Let us know if you need more help.

  • toclimateres
    Replied on November 16, 2016 at 10:14 AM

    Hi BDAVID, thanks for the speedy reply! Let me try again.

    Scenario:

    X is a drop down menu with 4 different options.

    Y and Z are YES or NO Buttons.


    If Y=YES, then Calc_Y = 0, regardless of the value of X

    If Y=NO and X=Option1, then Calc_Y = 1

    If Y=NO and X=Option2, then Calc_Y = 2

    If Y=NO and X=Option3, then Calc_Y = 3

    If Y=NO and X=Option4, then Calc_Y = 3

    If Z=YES, then Calc_Z = 0, regardless of the value of X

    If Z=NO and X=Option1, then Calc_Z = 3

    If Z=NO and X=Option2, then Calc_Z = 7

    If Z=NO and X=Option3, then Calc_Z = 6

    If Z=NO and X=Option3, then Calc_Z = 8

    Like the following:

    Regarding the Yes or No Button Image 1 Screenshot 20


    I just want to make sure there is no way to get around of using 8 (4*2=8) DIFFERENT if-statements for the scenario. Because I want to have 10 YES-or-NO buttons, which means I will end up having 40 if-statements. 

     

     

  • David JotForm Support
    Replied on November 16, 2016 at 11:33 AM

    From the looks of your setup, it would require a one condition per output.  I do not see a way to do this with calculations alone that would reduce the number of statements that would need to be made.

  • toclimateres
    Replied on November 16, 2016 at 7:17 PM

    Okay, thank you David!