try this and find out if it meets your need.

select f.account_num, f.account_name, s.origin_gbloc, avg(ff.q4), avg(ff.q5), count(1)
from f01names2 f, ff_cust_survey ff, shipment s
where ff.gbl_to = s.gbl_to
and f.account_num = s.origin_agent
and decode(s.origin_agent,1,s.origin_gbloc,'GTFL') = 'GTFL'
group by f.account_num, f.account_name, s.origin_gbloc
order by avg(ff.q4) DESC
/