5 Replies Latest reply on May 9, 2012 11:25 AM by hobbiesdeveloper

# Field Calculation Problem

### 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.

• ###### 1. Re: Field Calculation Problem

This Screenshot is showing a total of 605 in the On Po ("Products::onPO") field which is the total for all the items inside the PO, even if they are not the same item.

• ###### 2. Re: Field Calculation Problem

Here are all the fields that i have for Products Table.

• ###### 3. Re: Field Calculation Problem

ProductLineItems Fields

• ###### 4. Re: Field Calculation Problem

Purchase Order Fields

• ###### 5. Re: Field Calculation Problem

Relationship Table