I will suggest to get the data for each part into same record to make the calculation easier..
You will have to build two queries.. one with plant , storage loc , material and stock value in one query..
And part and stock quantity into another...
Once these two queries are setup just merge the query on material dimension which will give you the values in the same record and then you can have the formulas which will work for you..