For the complete documentation index, see llms.txt. This page is also available as Markdown.

Named Sets

Grouping members ..

Workshop - Named Sets

<!-- ============================================ -->
        <!-- ADD YOUR NAMED SET HERE - AFTER MEASURES     -->
        <!-- ============================================ -->
        <NamedSet name="Top 3 Territories">
            <Formula>TopCount([CUSTOMERS.Customers].[Territory].Members,3,[Measures].[Sales])</Formula>
        </NamedSet>
        
        <!-- If you have Calculated Members, they go after Named Sets -->
        
    </Cube>
</Schema>

Named Sets are particularly useful for:

  • Top/Bottom N analysis: Top 10 Products, Bottom 3 Territories

  • Strategic groupings: Key Accounts, Focus Markets, Priority Products

  • Complex member selections: Members meeting multiple criteria

  • Report simplification: Reducing complexity in frequently used queries

  • Consistency: Ensuring the same business logic is applied across all reports

Named Sets vs. Calculated Members

Understanding the difference between Named Sets and Calculated Members is crucial:

Aspect
Named Sets
Calculated Members

Returns

Set of members

Single member/value

Purpose

Group members together

Calculate new values

Definition

WITH SET clause

WITH MEMBER clause

Example

Top 3 Territories by Sales

Profit (Sales - Cost)

Follow the guide below to add a Named Set to the Miniature Models Schema:

MDX Query

  1. Open the Miniature Models - original.xml schema.

  2. To access MDX Query mode, from the menu select File > New > MDX Query.

MDX Query
  1. Click Ok to Connect & Enter the following Query into the top pane:

Copy & paste formula
  1. Click Execute.

Named Set MDX Query - Top 3 Territories

WITH SET Clause (Named Set Definition)

This creates a temporary named set called [Top 3 Territories] that exists only for this query.


TopCount Function

Breaks down as:

Component
Explanation

TopCount()

MDX function that returns the top N items from a set

[CUSTOMERS.Customers].[Territory].Members

Gets ALL territory members from the Customers hierarchy

3

Returns the TOP 3 items

[Measures].[Sales]

Ranks territories by Sales (highest to lowest)

What it does: Finds all territories, sorts them by Sales amount (descending), and returns the top 3.

Add NS to Schema

  1. Open the Miniature Models - original.xml schema

  2. Right-mouse click on the Sales_FY2003_2005 cube & select: Add Named Set.

Add Named Set - Top 3 Territories
  1. Expand the Named Set & Enter the following details:

Attribute
Value

name

Top 3 Territories

formula

Named Set - Top 3 Territories
  1. Select Formula & copy / paste Formula.

Enter Formula
  1. Click Save and Publish.

x

x

Last updated

Was this helpful?