Answered

Advanced variable ranking

  • 12 July 2023
  • 7 replies
  • 72 views

Hey everybody! I am hoping to use Typeform as a sort of matching engine. I’ve created a bunch of different variables (we’ll call them @a @b @c @d and @e) and assigned points based on the answers to various questions.

 

At the end of my Typeform, I want to show users a screen based on the variable with the highest number of points. For example, if after the entire flow the variables are as follows:
@a = 100

@b = 40

@c = 65

@d = 30

@e = 150

 

I want to show a screen that says something along the lines of “You ranked highest on @e!”.

I have the points system all set up but can’t quite figure out how to do the ranking and spit out the corresponding end point. Any advice? Is this possible?

 

Thanks so much in advance!

icon

Best answer by john.desborough 14 July 2023, 19:56

View original

7 replies

Userlevel 7
Badge +6

@arianashives - here’s a thread that i posted this morning that covers this off for 3 variables. the concepts are the same for 5 - 25 or more.. just means you have more possible combinations to look at to determine unique high score -

des

Thank you so much @john.desborough ! This is so helpful.

I’ve set up the first two pieces of logic but am a little stumped on the third. Some of my variable comparisons are equal to each other and all are greater than zero. Do I need to change my input numbers in order for the >/< 0 logic to work? Currently it’s getting stuck. Any advice would be greatly appreciated!

 

Userlevel 7
Badge +6

@arianashives - first you need to figure out the path to the outcome you want. 

if you have two variables who have the same ‘value’ ie 5 each, then your result of subtracting one from the other = 0 .. that means they are tied. 

if v1 = 5 and v2 =4, then the value of v1-v2 is positive and therefore the higher of that pair is v1 

if v1 =4 and v2=5 then the value of v1-v2 is negative and the higher of the pair is v2. 

what you need to do is to figure out the logic flow on a piece of paper then create the quiz. if you have the possibility of having ties and you want to do a tie breaker then you need to look at how you are going to do that - ie specific question to break a tie between v1 and v2 , v1 and v3 , v2 and v3 - for a three variable spot. 

in your case where you have the following: 

@a = 100

@b = 40

@c = 65

@d = 30

@e = 150

you would need to evaluate: 

  • a gt b, a gt c, a gt d, a gt e
  • b gt c, b gt d, b gt e
  • c gt d c gt e
  • d gt e

once you have those variables figured out then you need to look at unique high scores for each 

  • if a gt b and a gt c and a gt d and a gt e then go to ending for unique a
  • if b gt a (this is a negative value in a gt b calculation) and b gt c and b gt d and b gt e then go to ending for unique b
  • etc. repeat for c, d, and e

next you need logic rules to examine a tie for high score, something like this:

  • if A = B and A gt C and A gt D and A gt E then A and B are tied and have the highest score ( A-B =0 in the calculation)  then you would need to go to a tie breaker 
    • you can choose to have a simple tie breaker for ANY tie at top score - “ok two or more scores were tied for the highest ranking. To break the tie, we are going to ask you another general question” ….and then take them wherever you want based on their response
    • you can create individual questions to break ties at the high score level. how many questions to break the tie?? 
      • AB, AC, AD, AE, BC, BD, BE, CD, CE, DE - at the two only tied
      • ABC, ABD, ABE, ACD, ACE, ADE, BCD, BCE, CDE - at the three tied level
      • ABCD, ABCE, ACDE, BCDE - at the four tied level
      • ABCDE   if all are tied. 
    • so that looks like 24 tie breaker questions you would need to implement to address breaking  a specific tie. 

that should help.. at least i hope it does lol

 

des

 

Userlevel 7
Badge +5

Hi @arianashives I hope you’re doing well! Did the above work for you? Let us know if you need help setting it up!

@Liz @john.desborough I am so sorry for my very delayed response - this was so amazingly helpful, thank you so much! I got this to work with 11 variables :)

 

Thank you both so much!!!

Userlevel 7
Badge +5

Glad to hear it, @arianashives ! Let us know if there’s anything else we can help with. 😀

hello @john.desborough @Liz, I’m facing a similar scenario where I have a wellbeing assessment with 18 questions covering 6 axis (each connected to 3 questions)

I created 6 variables denoting each axis. Based on the lowest result, I need to spit out a set of recommendations. If there’s a tie with any number of axis, I can display one universal list of recommendations.

I read this thread a few times and I did not understand how to do this part:

you would need to evaluate: 

  • a gt b, a gt c, a gt d, a gt e
  • b gt c, b gt d, b gt e
  • c gt d c gt e
  • d gt e

once you have those variables figured out then you need to look at unique high scores for each 

  • if a gt b and a gt c and a gt d and a gt e then go to ending for unique a
  • if b gt a (this is a negative value in a gt b calculation) and b gt c and b gt d and b gt e then go to ending for unique b
  • etc. repeat for c, d, and e

next you need logic rules to examine a tie for high score, something like this:

  • if A = B and A gt C and A gt D and A gt E then A and B are tied and have the highest score ( A-B =0 in the calculation)  then you would need to go to a tie breaker 
    • you can choose to have a simple tie breaker for ANY tie at top score - “ok two or more scores were tied for the highest ranking. To break the tie, we are going to ask you another general question” ….and then take them wherever you want based on their response
    • you can create individual questions to break ties at the high score level. how many questions to break the tie?? 
      • AB, AC, AD, AE, BC, BD, BE, CD, CE, DE - at the two only tied
      • ABC, ABD, ABE, ACD, ACE, ADE, BCD, BCE, CDE - at the three tied level
      • ABCD, ABCE, ACDE, BCDE - at the four tied level
      • ABCDE   if all are tied. 
    • so that looks like 24 tie breaker questions you would need to implement to address breaking  a specific tie. 

 

Here’s the assessment’s scoring logic for reference:

 

Perhaps you can help?

Reply