Calculating a value from related field

Calculating a value from related field

I'm trying to do the following in a view.  In the form associated with the view I have a quantity field.  In a related database (based on an item that has been selected in the form) I have the price of the item.  I would like to have a formula field in the view that calculates a total cost from the quantity and the price in the related database for each record. is this possible?

thanks!