Logic to calculate final price and food portion | Community
Skip to main content
Answered

Logic to calculate final price and food portion

  • November 29, 2021
  • 6 replies
  • 134 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

Best answer by Liz

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. 

 

 

View original

6 replies

Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • 15028 replies
  • November 29, 2021

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:


  • Author
  • Explorer
  • 3 replies
  • November 29, 2021

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


  • Author
  • Explorer
  • 3 replies
  • November 29, 2021
hocicos wrote:

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

Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • 15028 replies
  • Answer
  • November 29, 2021

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. 

 

 


  • Author
  • Explorer
  • 3 replies
  • December 1, 2021
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.

john.desborough
Forum|alt.badge.img+6
  • Certified Partner & Champion
  • 5316 replies
  • December 1, 2021

@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