Question

Please help! Splitting typeform by comparing the scores of 2 variables

  • 7 September 2021
  • 9 replies
  • 829 views

Hey, 

I’ve built a calculator which works out how much a business could save by switching to solar energy. 

To generate this saving, I ask the user 2 key questions about their building and use these values to work out sub-scores in separate variables. 

At the end of this, I want to asses the 2 variables and compare their size. I then want to send users to 1 of 2 different thank you pages. This will be dependent on whether variable 1 is bigger than variable 2.

I can only seem to compare one variable against a number. E.g. if variable_1 is bigger than 0.


Does anyone have a solution or some guidance? Thanks a mil!​​​​​​​


9 replies

Userlevel 7
Badge +5

Hi @Andrew88 Thanks for stopping by! Do you mind sending some screenshots of what you already have setup? This will help us see where you’re at and how to help. :grinning:

Userlevel 7
Badge +6

@Andrew88 - from another user. 

to compare if one variable is bigger than another, you can do something like this (which i use in several quizzes):

  • create a numeric variable called a_gt_b and set it to 0
  • when it comes time to evaluate which of a or b is bigger:
    • if a is gt 0 then add a to a_gt_b
    • if b is gte 0, then subtract b from a_gt_b
    • if a_gt_b is greater than 0 then jumpto ending page “a is bigger”
    • if a_gt_b is less than 0 then jumptp ending page “b is bigger” 

you do need to figure out what to do in case of a tie.. 

just a thought or two that might help

 

des

Userlevel 7
Badge +5

Hi @Andrew88 were you able to give @john.desborough ‘s solution a try? 

Userlevel 1
Badge

In my case I have more than 2 variables that needs comparison to find the one with the largest number. How do suggest i achieve that please @john.desborough @Liz 

Thank you

Userlevel 7
Badge +6

@popekabu - if you look up above in this post you see the start of how to do the evaluation. there are several posts that i have made in the community that outline how to do this - try searching inside the community and see what you can find .. if you have specific questions once you have at least tried what is outlined above, let me know 

 

cheers

 

des

Userlevel 1
Badge

@john.desborough heres my question please

 

 

Userlevel 7
Badge +6

@popekabu - sorry if this seems a little grumpy but do a little search in here … you will find a lot of stuff already written. Either you do it or i have to go through and find the specific posts that i have previously made and then post the link for you. 

my help in here is as a volunteer in the peer to peer support side. i am asking you to do a little work searching for the prior posts and try to do this on your own first. 

at the moment I am busy supporting several paying clients this afternoon, building out typeforms. I will check back to see how you have done in terms of finding the other posts and trying it out for yourself .. 

 

Userlevel 1
Badge

I've tried the ones outlined here. The examples used here works with two variables comparison, mine is a 10 variable comparison. Nonetheless, thank you, i understand 🙏🏽 @john.desborough 

Userlevel 7
Badge +6

here’s a hint on the fact that it has been done for a 12x12 comparison 

all it takes is thinking it through to extend from 2 to 3 to 4 etc. 

the logic rules are a bugger but that is another story

 

Reply