I have created a udf to get the PO qty and another field as shortage qty. I'm using the fms below to get value here. But it give internal error and while checkin the query it shows " Oper and data type nvarchar invalid for substract operator". The udf's created are of type units and totals and the type is quantity.
SELECT $[pdn1.U_POQty] - $[pdn1.Quantity]