Feedback
Solved

Logic to calculate final price and food portion

  • 29 November 2021
  • 6 replies
  • 64 views

How can I use logic so that according to a weight I calculate the ration and the final price of the product? Thank you

icon

Best answer by Liz 29 November 2021, 22:42

View original

6 replies

Userlevel 7
Badge +5

Hi @hocicos Happy Monday! I hope you’re having a good week so far. What is the calculation you need to do behind the ration? That’ll help me create an example of how to set this up for you. :smiley:

Nosotros preguntamos el peso del perro, con ello deberia de darnos internamente la racion para multiplicarla por 30 dias y por el precio del kilo de producto

Nosotros preguntamos el peso del perro, con ello deberia de darnos internamente la racion para multiplicarla por 30 dias y por el precio del kilo de producto

We ask the weight of the dog, with this he should give us internally the ration to multiply it by 30 days and by the price of the kilo of product
Userlevel 7
Badge +5

Hi @hocicos Ok, I think I figured out a solution for you. You’ll have to change this up a bit depending on how many products you have/their weight/etc, but hopefully this helps!

 

  1. First, create a variable that has the weight of the products stored within that variable. You’ll also want to add a variable for the dog weight. 

 

  1. Next, you’ll need to add a calculation to the question that asks the respondent what product they want. I’ve chosen to multiply by 30 in this question, but if you know that all products are going to be multiplied by 30, then I would do this calculation within the product weight variable instead. (For example, I would set the product weight to 60.)

 

  1. Then, add the calculations to the question that asks for the dog’s weight like this: 

 

And then you’ll have the calculations! You can test out my example below, and on the ending page, I’ve recalled the score variable so you can see the math. 

 

 

If I only put one variable, it works fine, but we need several with various weights and that is where it no longer does the operations for us.
Userlevel 7
Badge +6

@hocicos = if you can write out your equation on a napkin/piece of paper, in basic math, you can create the logic rules in a series to do that inside Typeform. 

des

Reply