Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Top N results

Status
Not open for further replies.

neronikita

Technical User
Feb 20, 2002
159
US
I am using Actuate 8. Does anyone know how to show just the TOP N records of a report, such as the Top 10? I figure it has to do with RowNumber, but I haven't figured it out yet.

Thanks,

Di

If needed, here is my SQL:

select
wct_cat_lvl4_nme,
count(wct_cat_lvl4_nme) as Lvl4Cnt, aa.totals,
cast(count(wct_cat_lvl4_nme) as decimal)/aa.totals as pct
from incidents,
(select count(*) as totals
from incidents
where open_time >= :sdate and open_time < :edate and wct_orig_grp_nme = 'ess%) aa
where open_time >= :sdate and open_time < :edate and wct_orig_grp_nme = 'ess%
Group by wct_cat_lvl4_nme, aa.totals
Order by count(wct_cat_lvl4_nme) desc
 
Since you get the data from the query already ordered, assign N (Top N) to the FetchLimit property of the datastream.

i.e. if you want to show Top 10, assign 10 to the FetchLimit.

To make it better, you can create a parameter for Top N, then use that parameter in the FetchLimit property assignment.

I hope this helps.

-- JB
 
Thanks! I haven't become very familiar with all of those properties and methods and so forth yet. Thanks for the help!

Di
 
Have you tried adding TOP 10 to SQL; Eg:


select
TOP 10
wct_cat_lvl4_nme,
count(wct_cat_lvl4_nme) as Lvl4Cnt, aa.totals,
cast(count(wct_cat_lvl4_nme) as decimal)/aa.totals as

Make sure you have ORDER BY DESC on the vital column.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top