Answered

Using varables to determine a logic endings

  • 6 December 2023
  • 8 replies
  • 80 views

Userlevel 1

Hello community,

I am relatively new to using Typeform and need assistance with a case I've been working on for some time. Any help would be greatly appreciated :)

I work for an association that uses a pricing grid to calculate the subscription amount for its members (businesses). I have attached this grid below.
 

We use 3 categories (columns): the number of employees, the total amount of funds raised, and the annual turnover. Belonging to two of these categories (out of 3) determines the member's subscription tier (ranging from 1 to 5 - the rows). We assume that membership is defined by the two highest brackets reached.

Using a Typeform, we collect information (number of employees, total amount of funds raised, and annual turnover) from our members using multiple-choice questions (see screenshot).

 

 

In order to display an end slide for each possibility, we tried using the quiz score, but it doesn't work. We are stuck on the variables. Who could help us? Thank you very much.

 

 

icon

Best answer by john.desborough 7 December 2023, 18:59

View original

8 replies

Userlevel 7
Badge +5

Hi @JulDu Happy Wednesday! Thanks for sending these screenshots over - super helpful! @john.desborough has handy guides for using variables for more tricky situations like this. He might have one that can help!

Userlevel 1

Hi @Liz many thanks for your quick reply. Waiting for @john.desborough message :) Have a good one 

Userlevel 7
Badge +6

@JulDu @Liz  - the logic rules would need to determine which ‘pairing’ point to which endings and which pairing is the highest.. my basic assumption is that you can rank each of the 3 categories on a 1-5 basis ie number of employees has 5 ‘levels’ on your image and can correlate to a 1-5 scale - if you can do that for the other two categories that makes it easier to ensure we are comparing ‘same’ scoring scales

i have used v_c1, v_c2 and v_c3 to represent the scoring for the three categories on the 1-5 range

in the details you provide, what happens if all three of the categories are tied for high  score - to which ending do you send them? 

basic logic rules

  • if v_c1 = v_c2 and v_c1=v_c3 then go to “three tied ending” 
  • if v_c1 = v_c2 and v_c1 greater than v_c3 then go to ‘c1 and c2’ ending 
  • if v_c1 = v_c3 and v_c1 greater than v_c2 then go to ‘c1 and c3’ ending 
  • if v_c1 greater than v_c2 and v_c2 greater than v_c3 then go to ‘c1 and c2’ ending 
  • if v_c1 greater than v_c3 and v_c3 greater than v_c2 then go to ‘c1 and c2’ ending 
  • if v_c2 = v_c3 and v_c2 greater than v_c1 then go to ‘c2 and c3’ ending 
  • if v_c2 greater than v_c1 and v_c1 greater than v_c3 go to ‘c1 and c2’ ending 
  • if v_c2 greater than v_c3 and v_c3 greater than v_c1 then go to ‘c2 and c3’ ending 

what you will need to figure out is what you are going to do in the case of this construct

  • if v_c1 greater than v_c2 and v_c2 = v_c3 go to ???? - do you have a tie breaker ??? 

work out all the possible combinations that might exist and then add in the rules to route your folks to the appropriate ending

 

des

Userlevel 7
Badge +5

Hi @JulDu How did Des’s solution go for you? Let us know if you need help setting it up!

Userlevel 1

Thank you so much @john.desborough it help me a lot! 

 

I'll keep you posted on the progress of our typeform:) 

 

Best regards, 

Jules

Userlevel 7
Badge +5

Glad to hear it, @JulDu ! Let us know how it goes with the form!

I’ve read several of these posts (including many by @john.desborough  and I’m totally lost  where people are comparing the two variables.

In my variables I only have the option to say “Greater than a #” and it won’t let me compare GREATER THAN other variable. See my screenshot below.

I have it calculating properly and it displays properly at the end. I just have no way to have them compare each variable to the other to see which is bigger so I can determine which ending screen is shown.

 

 

Userlevel 7
Badge +6

@iapath - short answer is that you can’t 

 

if you want to know if v1 is greater than v2, create a third variable called v1_vs_v2 (just an example of how i try to denote comparison variables) 

logic rules: 

  • if v1 greater than 0 add v1 to to v1_vs_v2
  • if v2 is greater than 0 subtract v2 from v1_vs_v2

now you have 3 possible results 

  • v1_vs_v2 is greater than 0 --- means v1 is bigger than v2 
  • v1_vs_v2 is = 0 --- means they are tied
  • v1_vs_v2 is less than 0 --- means v2 is bigger than v1

you can use the above scenarios in logic rules to go set other variables ie text variables with content based on the result or drive them to specific pages/endings  or even a tie breaker question. 

 

trust me - i have asked for the ability to use two variables in this type of logic from Typeform in the past. One day, soon, i hope!

 

des

 

Reply