                                    AND NVL(to_date(nvl(:V4,:ENDTIME),'YYMMDDHH24MISS'),SYSDATE)) H) H) ,
 
 ash as(SELECT b.*,
-              CEIL(SUM(AAS) OVER(PARTITION BY SQL_PLAN_LINE_ID,&OBJ)) tenv
+              ROUND(SUM(AAS) OVER(PARTITION BY SQL_PLAN_LINE_ID,&OBJ)*100/SUM(AAS) OVER(PARTITION BY SQL_PLAN_LINE_ID),1) tenv
        FROM (select /*+no_expand no_merge(b) ordered use_hash(b)*/ b.*
              FROM   qry a,ash_detail b 
              WHERE  a.phv = nvl(nullif(b.sql_plan_hash_value,0),a.phv)

           ROUND(COUNT(DECODE(wl, 'Concurrency', 1)) * 100 / COUNT(1), 1) "CC",
           ROUND(COUNT(DECODE(wl, 'Application', 1)) * 100 / COUNT(1), 1) "APP",
           ROUND(COUNT(CASE WHEN wl NOT IN ('ON CPU','User I/O','System I/O','Cluster','Concurrency','Application') THEN 1 END) * 100 / COUNT(1), 1) oth,
           MAX(&OBJ||'('||tenv||')') KEEP(dense_rank LAST ORDER BY tenv) top_event
    FROM   ash
    GROUP  BY nvl(SQL_PLAN_LINE_ID,0)),
ash_agg AS

qry AS
 (SELECT DISTINCT sql_id sq,
         flag flag,
         'BASIC ROWS PARTITION PARALLEL PREDICATE NOTE REMOTE &adaptive &fmt' format,
         plan_hash_value phv,
         coalesce(child_number, plan_hash_value,0) plan_hash,
         inst_id
