SSRS: Top n AND Bottom n (filter)

10,075

You can do this by defining two groups. One group has a filter for the Top 5 and the other the count of records less 5 as a Bottom N filter

This technique is described in full at http://www.bidn.com/blogs/mikedavis/ssis/172/top-n-bottom-n-grouping-in-ssrs-2008

If there is a chance on getting duplicate records at the boundary you need to retrieve the boundary value and return all those matching that value or (more/less depending on top/bottom).

The duplicate handling can be done eg http://www.bidn.com/blogs/mikedavis/ssis/1875/ssrs-top-n-and-bottom-n-reporting-with-duplicates

Share:
10,075
adolf garlic
Author by

adolf garlic

Enjoying the view

Updated on August 19, 2022

Comments

  • adolf garlic
    adolf garlic over 1 year

    Is there a way you can filter in SSRS to return only the Top N AND the Bottom N

    e.g. If I have the numbers -50 through to +50

    and I filtered on Top 5 and Bottom 5

    I would expect to see

    -50,-49,-48,-47,-46,46,47,48,49,50

    Is this possible, it certainly allows it when I've tried it but it appears to ignore the second filter