Business Intelligence Blogs

View blogs by industry experts on topics such as SSAS, SSIS, SSRS, Power BI, Performance Tuning, Azure, Big Data and much more! You can also sign up to post your own business intelligence blog.

Top N, Bottom N Grouping in SSRS 2008

  • 12 November 2009
  • Author: MikeDavis
  • Number of views: 61645
  • 0 Comments

I had a Client recently that wanted to show the top N of a query on a report and have the rest separated into another group. The top N is easy but the bottom N would changed based on the number of rows in the query. So I had to figure out a way to calculate this number. I created two groups on the report. The first I placed a filter of “top 10”.

Top N, Bottom N Grouping in SSRS 2008

In the second group I placed a filter of bottom N, but I had to calculate the N by subtracting the count of the rows in the dataset.

Top N, Bottom N Grouping in SSRS 2008

I used the count function on a field in the dataset and subtracted 10 to remove the top 10 rows. So the results look like so:

Top N, Bottom N Grouping in SSRS 2008

Print
Tags:
Rate this article:
5.0
MikeDavis

MikeDavisMikeDavis

Other posts by MikeDavis

Please login or register to post comments.