Feb 02, 2022 11:03 AM
Hi,
I am trying to build a formula to properly calculate the cost for an order whose input is a multi-select field of products.
I did my best to follow these recommendations:
The tables are Products, Orders, and Line Items.
The Products Table (includes lookup to the Line Items Table).
The Orders Table (includes lookup to a Companies Table (not pictured))
The Line Items Table (includes lookup to the Products Table)
I don’t know how to create the field for Total Cost in the Line Items Table to be able to calculate total cost dependent upon which products are linked. On the front end a user would select which products they wish to include in their order.
Any pointers or reference to existing community content would be appreciated. Thanks!
Solved! Go to Solution.
Feb 02, 2022 12:26 PM
Welcome to the community, @Godel!
Are you saying that you just want to add up those unit costs to give you a total cost? You would just need to create a rollup field called “Total Cost”, have it point to the Products table (because Products is your linked record field), then choose the Unit Cost field, and then type the formula: SUM(values)
That would be the way to do it based on your current setup, although a likely better setup would be to have each record in your line items table include one product instead of multiple products. Then, your rollup field would be back in your orders table.
Feb 02, 2022 12:26 PM
Welcome to the community, @Godel!
Are you saying that you just want to add up those unit costs to give you a total cost? You would just need to create a rollup field called “Total Cost”, have it point to the Products table (because Products is your linked record field), then choose the Unit Cost field, and then type the formula: SUM(values)
That would be the way to do it based on your current setup, although a likely better setup would be to have each record in your line items table include one product instead of multiple products. Then, your rollup field would be back in your orders table.
Feb 02, 2022 01:01 PM
Very cool @ScottWorld
I think I’m in better shape than I was before.
Is this more in line with what you were thinking?
Feb 02, 2022 01:22 PM
Yeah, that looks pretty good!