AnsweredAssumed Answered

Field Calculation Problem

Question asked by hobbiesdeveloper on May 9, 2012
Latest reply on May 9, 2012 by hobbiesdeveloper

Title

Field Calculation Problem

Post

Hello,

The problem that I'm having right now is trying to get the Products::onPO field to calculate only the matching ProductID and not all items from Purchase Order. Could someone please help me find a way to solve this problem, it might be something to do with the Table Relationship setup which I have provided screenshots for.

Here is a list of all my tables that I use.

Dashboard

Customers

Order

Product

OrderLineItem

ProductLineItem

Vendor

PurchaseOrder

The ProductLineItem, Purchase Order, Product is what I'm trying to use make my calculation in Products::onPO working.

The calculation in the Products::onPO is:

If( IsEmpty( Sum( product_productlineitem_po_LI::Quantity ) ) ; "0" ; Sum( product_productlineitem_po_LI::Quantity ) )

The product_productlineitem_po_LI::Quantity is the line item inside the Purchase Order which is from a different table, you should be able to see how the relationship is linked in the screenshot.

I have included all the screenshots with what they are.

Please review the screenshots and let me know what the problem might be. Also for the Relationship Tables, I'm using only "=" to each id that I have linked to each other.

This screenshot PurchaseOrder_Screenshot shows the ProductLineItem Quantity for each item that is added which is being added in the Products::onPO field for the total sum of all the items inside the Purchase Order, I need it to calculate just the total from all the Purchase orders just for the same Product and not for different Items as well which is what it's doing right now.

PurchaseOrder_Screenshot.jpg

Outcomes