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! Go to Solution.
Youโre using LOOKUP() wrong.
Try instead:
SUM(SELECT(products[Price], IN([Name/Size/Color],[_THISROW].[products])))
I think its very interesting question. I hope I will get an answer.
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
User | Count |
---|---|
39 | |
29 | |
23 | |
23 | |
13 |