4
votes

How can I limit the number of rows returned in a group?

So far, when the report runs, it returns a lot of records for each group. However, I only want it to return the top 4 records in each group.

I tried the expression: =Ceiling(RowNumber(Nothing)/4) but that's not what I am looking for.

I am using SQL Server 2012 Data Tools (Visual Studio 2010)

Thanks.

1
Can you do it in the SQL?Tab Alleman
I could, but eventually the user will want to filter by different rows. For now, I want to set it to 4 rows on Reporting Services. Finding out how to do this will make it easy to change it later. I don't want to hard code it on the Stored Procedure that I am using.Guillermo Greco

1 Answers

6
votes

In the group's properties, set a filter on the field you want, choose "Top N" as the operator, and 4 as the value.