Defining named sets
Named sets group either one or multiple dimension members based on certain criteria. Named sets could be either dynamic or static. Static sets are evaluated once you define the set, whereas dynamic sets are evaluated at the time of query execution. In this section, we will first build a static named set of the top three resellers and validate it with queries, and then make the set dynamic to note the difference.
How to do it...
Let's get started. To build a named set of the top three resellers in terms of sales amount:
- Right-click on the Top N Count template, and choose Add Template.
- Call the named set
Leading Resellers
, and edit the calculation as follows:TOPCOUNT ([Reseller].[Reseller].[all resellers].children, 3, measures.[reseller sales amount])
- Change the Type property to Static, and save the changes.
- To verify the named set, switch to SSMS, and execute the following query (the results are shown immediately after the query):
SELECT measures.[reseller sales amount...