I'm trying to calculate an inventory quantity but have not had success in getting the right inventory quantity to display.

The records are a portal but all the fields are within the same table 'RecordsOfUsage'

I have three fields

QtyAdd defined as a number default data value is 0

QtyDistribute defined as a number default data value is 0

QtyInventory defined as a calculation

The calculation for QtyInventory is as follows;

If (QtyAdd ≠ 0; QtyInventory + QtyAdd; If (QtyDistributed ≠ 0; QtyInventory - QtyDistributed;QtyInventory))

This is a sample of my results

Thanks

Scott

Is the answer suppose to be 40? It appears you are trying to take the Inv number 50 and minus 10. It's not going to work the way you have it set up, and you calculation is wrong. What happens if someone puts numbers in both Qty Dist & Qty Add (say on your first portal row, 10 and 50)?

You need to keep a running total of the inventory in another field.

Here's a sample from Eos that may point you in the right direction