all groups > sql server reporting services > june 2006 >
You're in the

sql server reporting services

group:

TOP (N) HELP!!!!



TOP (N) HELP!!!! Benw
6/16/2006 7:28:01 AM
sql server reporting services: I have been frustrated with this for weeks. I have a report that is grouped
by type with a sum of all the types that happened in a certain period.
like

carpet 34
drywall 31
siding 29
etc...................

I have a whole list grouped by that type and sorted by the number or (Count)

SELECT smServCall.ServiceCallID, smServCall.ShiptoId,
smServFault.FaultCodeId, smServFault.Crtd_DateTime, smServCall.CallStatus,
smServCall.CallType
FROM smServCall INNER JOIN
smServFault ON smServCall.ServiceCallID =
smServFault.ServiceCallId
WHERE (smServCall.CallType = 'CLOSING')

PS.....FaultCOdeId is my type
I cant figure out how it can give me just the types with the 5 highest
counts. I know it is Top(N) but where and how I cant figure out. I will end
this with my datasert query in hopes of some help.. Thanks

Re: TOP (N) HELP!!!! jhcorey NO[at]SPAM yahoo.com
6/16/2006 7:45:53 AM
I'm not sure if you want to do this in sql or in rs.
In sql you could wrap another statement around your existing one:

select top 5 FaultCodeID,count(*) as count
from
(
.... your sql ...
) as query
group by FaultCodeID
order by count desc

Otherwise if the sum is already in your report, you should be able to
use the Top N
in the group properties.

HTH
Jim

[quoted text, click to view]
Re: TOP (N) HELP!!!! Benw
6/16/2006 7:56:02 AM
How would I do that in my group properties. I have a sort descending of
countdistinct(servicecallID.value) My group is the faultCode. I just cant
figure out the the syntax to use in an actual formula in reporting services
for Top(N)

[quoted text, click to view]
AddThis Social Bookmark Button