I don't know the structure of the file you mentioned - exactly which steps do you use to collect the information?
Why don't you just use the snapshot table functions to get the statement information, and apply some simple GROUP BY, SUM, and FETCH FIRST clauses to filter the data?