I'm calculating the stock value for products we make and the calculation is easy: StockValueProduct = ProductionCostPerItem * NumberInStock and all sorted by ProductNumber.
I have have one table, called Transactions where I keep track of costs and revenues as well as items in and out.
The field ProductionCostPerItem is calculated as ProductionCost / NumberOfItemsManufactured. Both these fields are summary fields so the calculation looks like GetSummary ( ProductionCost ; ProductNumber ) / GetSummary ( NumberOfItemsManufactured ; ProductNumber ) (and - yes - I check that I'm not dividing by zero).
Also the NumberInStock is a summary field, so the stock value is calculated as GetSummary ( NumberInStock ; ProductNumber ) * ProductionCostPerItem.
So far, so good. In my report, with a sub-summary part for ProductNumber, the stock values for each product seem to be correct.
But no matter how I try, I cannot get the grand summary of my stock value right. I've tried using a calculation field and Sum ( StockValueProduct ) which gives me zero and I've tried using a summary field using the same field, which gives me a way to high value.
I have no idea what's going on and any hints would be most appreciated.