Compartilhar via


Members (Set) (MDX)

Returns the set of members in a dimension, level, or hierarchy.

Syntax

Hierarchy expression syntax
Hierarchy_Expression.Members

Level expression Syntax
Level_Expression.Members

Arguments

  • Hierarchy_Expression
    A valid Multidimensional Expressions (MDX) expression that returns a hierarchy.
  • Level_Expression
    A valid Multidimensional Expressions (MDX) expression that returns a level.

Remarks

If a hierarchy expression is specified, the Members (Set) function returns the set of all members within the specified hierarchy.

If a level expression is specified, the Members (Set) function returns the set of all members within the specified level.

Important

When a dimension contains only a single visible hierarchy, the hierarchy can be either referred to either by the dimension name or by the hierarchy name, because the dimension name in this scenario is resolved to its only visible hierarchy. For example, Measures.Members is a valid MDX expression because it resolves to the only hierarchy in the Measures dimension.

Examples

The following example returns the set of all members of the Calendar Year hierarchy in the Adventure Works cube.

ELECT 
   [Date].[Calendar].[Calendar Year].Members ON 0
FROM
   [Adventure Works]

The following example returns the 2003 order quantities for each member in the [Product].[Products].[Product Line] level. The Members function returns a set that represents all of the members in the level.

SELECT 
   {Measures.[Order Quantity]} ON COLUMNS,
   [Product].[Product Line].[Product Line].Members ON ROWS
FROM
   [Adventure Works]
WHERE
   {[Date].[Calendar Year].[Calendar Year].&[2003]}

See Also

Reference

MDX Function Reference (MDX)

Help and Information

Getting SQL Server 2005 Assistance

Change History

Release History

17 July 2006

Changed content:
  • Updated syntax and arguments to improve clarity.
  • Added updated examples.