Math Column and Logic Calculations

I have a formula working perfectly in the Google Sheet but because of the delay in calculations I need to use the Math Column, however I can’t for the life of me get it to work as calculations in Glide.

I want a user to select an option from 3, for this I’m using the choice component. Based on the response I want a value selected that is then added to another number.

In the Google Sheet I am using IFS to iterate through the choices and present the right number to add.

I have tried using If Then Else and Math but the choice component stops working. Help please!

Have a single relation - lookup matching that “option” you let users choose to take back the value you want to do the calculation, then create a math column and add that number to the “another number” you want. Would that work for you?

Or if you don’t care about storing that “option” you can let users choose that option at the front end, but at the back end store directly the value you want to do calculation with.

Thanks @ThinhDinh there are different values for the 3 options for many of the line items. So I’m not sure I follow. I’m also yet to implement relations correctly and have an open question because what I’ve done on a many to one relation doesn’t seem to have worked.

Can I see some screenshots about your current settings for relations and what are the options & values for the choice component? Thank you.

I haven’t done relations for this. I’ve got them to work now for the instance I was referring to with Lucas’s help.

So Choice component will have different costs for different products. Not sure if this shows what you are asking?Screenshot 2020-06-23 at 02.00.39

So what I imagine would be:

  • Show the shipping option as countries (UK/Europe/International)
  • In the backend instead of writing the countries’ name, write the shipping fee to the column you’re using to store that choice component.
  • Have a math column to add the product price + shipping fee.

Is that what you want?

That makes sense let me try it so your 1st statement: * Show the shipping option as countries (UK/Europe/International), I should leave the front end as-is?

Second part: write the shipping fee to the column you’re using to store that choice component.
Each product has it’s own price so I’m not sure I follow this one. This is the current choice component screenshot.

Third part- Math column is ok I have that but need the above to work first.Screenshot 2020-06-23 at 02.16.55

Yeah you should leave the front end as it is. What are you trying to take back from a “UK” choice, is that a shipping fee that is fixed or it varies based on the product?

If it varies then you must do a relation.

The shipping fee for the 3 different locations will vary depending on product. From the UK choice I’m getting the shipping fee.

Struggling to visualise the relation. So I would have a sheet with items each item with 3 different shipping fees and then the current choice table and do a relation? Not sure that works and how the choice component would facilitate the user selection.

Yeah I envision it to be a bit tricky for this case as the shipping fee varies.

To make it work it will probably cost a lot of rows but you can have a template column joining the product code/name with the shipping option in a sheet called “Fee Lookup”, then do a relation matching the product code/name and shipping choice from the user to that sheet, take back the corresponding fee.