I find that it helps to think of the analytic functions as a presentation layer added into the SQL.
First write the SQL to acquire the data and aggregate it to produce the correct result set.
Then add analytic columns which add value to the data. Then optionally use some analytic results to reduce the output again.
Regards
Jonathan Lewis http://www.oracle.com/technology/community/oracle_ace/ace1.html#lewis
The Co-operative Oracle Users' FAQ http://www.jlcomp.demon.co.uk/faq/ind_faq.html
Cost Based Oracle: Fundamentals http://www.jlcomp.demon.co.uk/cbo_book/ind_book.html
-- //www.freelists.org/webpage/oracle-l