If you create a transaction saved search where Account = Scrap Expense and Revenue accounts or Account Type = Income (depending on your definition of Total Revenue) and Posting = T, won't that work?
Results:
Case when Account = Scrap Expense then {amount} ELSE 0 END/NVL(Case when Account/Account Type = Revenue accounts or Income account type THEN {amount} ELSE 0 END),0)
Summary Type: Sum
Obviously, my internal IDs are wrong.