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?

Solved Solved
0 10 311
1 ACCEPTED SOLUTION

Youโ€™re using LOOKUP() wrong.

Try instead:

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

View solution in original post

10 REPLIES 10

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

Steve
Platinum 4
Platinum 4

Yep.

Yep.

Thank you for your response.

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.

Youโ€™re using LOOKUP() wrong.

Try instead:

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

Yeah! This work! Thank you

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

Top Labels in this Space