Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Analysis Server and Reporting Services (2008)
 TOP N?

Author  Topic 

Adam West
Constraint Violating Yak Guru

261 Posts

Posted - 2009-11-05 : 12:11:01
In Crystal Reports, they had a feature called TOP N, that you could use to show only the number of lines in a report, u can also link it as a group so it would show top customers based on total lines.

I need to do the same in SSRS as all of my work has been coversions of Crystal but I don't see this option. is this available in SSRS?

JCirocco
Constraint Violating Yak Guru

392 Posts

Posted - 2009-11-05 : 14:15:47
AW,

Example I helped someone else with...
T-SQL also supports a top %


select top @topselect
invoice.vendorname,
invoice.vendornumber,
invoice.vendorparent,
Sum(invoice.InvoiceAmountUSD) As 'InvoiceAmount'
from invoice
order by invoiceamount

or hard coded as

select top 5
invoice.vendorname,
invoice.vendornumber,
invoice.vendorparent,
Sum(invoice.InvoiceAmountUSD) As 'InvoiceAmount'
from invoice
order by invoiceamount



John
It's a small world (but I wouldn't want to paint it)
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2009-11-05 : 14:49:28
I guess he's asking for SSRS functionality



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

JCirocco
Constraint Violating Yak Guru

392 Posts

Posted - 2009-11-05 : 20:04:11
well SSRS does use a SQL statement (or stored procedure) as part of its functionality... Also in crystal they use SQL to feed data to reports and it is just presented differently to the developer. I'm just sayin'

John
It's a small world (but I wouldn't want to paint it)
Go to Top of Page

Adam West
Constraint Violating Yak Guru

261 Posts

Posted - 2009-11-06 : 09:02:33
I don't care per se about SSRS Functionality. I use more stored procedures in SSRS than I did with Crystal.
Go to Top of Page

JCirocco
Constraint Violating Yak Guru

392 Posts

Posted - 2009-11-06 : 12:49:34
AW, I create my stored procedures like my first example and then either have user select parm of top whatever at run time or I pass it in the call to SP as a constant the same for every report.

John
It's a small world (but I wouldn't want to paint it)
Go to Top of Page
   

- Advertisement -