Skip to main content
Answered

Calculating variables into recall information


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?  

Best answer by john.desborough

@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

View original

Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • October 11, 2023

@john.desborough might be your guy for this!


john.desborough
Forum|alt.badge.img+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


Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • October 12, 2023

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.


Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • October 13, 2023

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… 


john.desborough
Forum|alt.badge.img+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