Jagan has given you the way to do so ,
May this in detail will make you clear
,If (D= 'Sales' and E= 'Profit', A - B,
If(D='Commissions' and E = 'Loss', somecalculation)) AS XXXX
drop table Table1;
Now you can use one more resident load from table 2 if you want to exclude on basis of field XXXXX.