# References from Enum List

Hi!

We create smart warehouse applications.

There are tables:
products - here all information about our products (ProductId - Key, Photo, Name/Size/Color - name of product, Price and others)
Orders - OrderId - Key, Client - Ref to Clients, Products - EnumList Ref to Products, Price - here problem and others

One order can contain several items of products. We want to calculate the total cost of the order based on the Price column in the Products table, but from the articles we have read, we cannot yet understand how it is. Is it possible to create a field that will â€śpullâ€ť prices from the Products table and summarize it if there are several products in the order? At the same time, we want the value in the field to be editable? Can this be done?

I think its very interesting question. I hope I will get an answer.

Yep.

Yep.

1 Like

Could you write how to do it?

I have tried â€śLOOKUP(products, â€śproductsâ€ť, â€śname/size/colorâ€ť, â€śpriceâ€ť)â€ť in App Formula, but it doesnâ€™t work.

Hi, the below expression should work.

SUM(SELECT(Product[Price], CONTAINS([Products],[ProductId)))

In my variant: SUM(SELECT(products[Price], CONTAINS([Name/Size/Color],[products])))
And it is working, but only for 1 product. If I add a several products in 1 order, the sum = 0(

I have also tried with SPLIT, like: SUM(SELECT(products[Price], CONTAINS([Name/Size/Color],SPLIT([products],", ")))). And it doesnâ€™t work with several products in one order.

Constructions that i have tried:

SUM(SELECT(products[Price], CONTAINS([Name/Size/Color],SPLIT([products],", "))))
SUM(SELECT(products[Price], CONTAINS([Name/Size/Color],ANY([products]))))
SUM(SELECT(products[Price], CONTAINS([Name/Size/Color],ANY(LIST([products])))))

And all of them doesnâ€™t work

Youâ€™re using LOOKUP() wrong.

``SUM(SELECT(products[Price], IN([Name/Size/Color],[_THISROW].[products])))``