We can use the below formula in a transaction search
CASE WHEN {type} = ‘Transfer Order’ AND {transactionlinetype}= ‘Item’ AND {closed}=’F’ THEN ABS({quantity})-{transferorderquantityreceived} ELSE NULL END
The below formula to get on order from both PO and TO in a single column
NVL(CASE WHEN {type} = ‘Purchase Order’ THEN {quantity}-{quantityshiprecv} ELSE NULL END,CASE WHEN {type} = ‘Transfer Order’ AND {transactionlinetype}= ‘Item’ AND {closed}=’F’ THEN ABS({quantity})-{transferorderquantityreceived} ELSE NULL END)