Answered

Calculating variables into recall information

  • 11 October 2023
  • 7 replies
  • 68 views

Hi, I’m trying to do something that seems like exactly what Variables + Recall are built for, but can’t seem to figure out how to do it.

We want to have users tell us (a) how many miles they drive each year (b) their car mileage and (c) the price of gas where they live.  After they input A, B and C, we want to feed back a Statement that says “We think you’ll pay (D) for gas.

I’ve created @milesdriven @mileage @gasprice @gallonsperyear @gasperyear that are conceptually linked as follows:.

@milesdriven (A) / @mileage (B) = @gallonsperyear (C) * @gasprice (D) = @gasperyear (E)

A, B, and D are customer input.  I’ve set up logic for A, B and D so that when someone answers how many miles they drive = 10,000, that is added to @milesdriven, etc.  So they answer these questions and the A, B, D variables should then retain their answers.

I’ve then set up logic in one of the questions saying [Always] [divide] [@milesdriven] / [@mileage]), which should equal @gallonsperyear - but there is no way that I can see to connect that Logic to @gallonsperyear so that I can save the output into that variable (C) and then do the same to multiple by (D) and use that to spit out (E) into a number that can be Recalled into a statement to user.  

Nor can I set up a Custom Variable to reference another Custom Variable into an equation.  So I can only do one math step.  

Am I missing something that with all this logic functionality there’s no way to do the basic math here?  

icon

Best answer by john.desborough 11 October 2023, 19:27

View original

7 replies

Userlevel 7
Badge +5

@john.desborough might be your guy for this!

Userlevel 7
Badge +6

@nathanwyeth  @Liz 

 

try this sample … note there is one quirk in Typeform that i call out on question 3

 

 

and here’s what i had on the statement page

des

Userlevel 7
Badge +5

Let us know how this goes for you, @nathanwyeth !

Hey John and Liz - thanks so much!  This clicked for me for how to approach it.  I’ll come back if I run into anything that I get stumped on.

Userlevel 7
Badge +5

Glad to hear it, @Taichi Hobbs ! Circle back if you get stumped on anything or just want to give us an update on the progress. 😀

I don’t suppose it’s possible to format the numerical answer to add a comma after 3 digits?  I.e. $1,000.   

It would be so nice… 

Userlevel 7
Badge +6

@Taichi Hobbs - formatting like that is not available.. just like you can’t enter in 3.56 in a number question - won’t let you put in decimal places.. that’s why the example above uses ‘cents per gallon’ then divides by 100.cuz THAT will give you two decimal place (won’t show 3 or 4 places tho.) 

des

Reply