Export (0) Print
Expand All
Avg
IIf
Lag
Max
Min
Mtd
Qtd
Sum
Var
Wtd
Ytd
Expand Minimize
0 out of 1 rated this helpful - Rate this topic

Leaves (MDX)

Updated: 17 July 2006

Returns a set composed of all attributes (optionally limited to those belonging to a specific dimension). For each attribute x in the return set, if x is the granularity attribute or is directly or indirectly related to the granularity attribute, the granularity is set on attribute x without affecting the slice. The Leaves function is designed for use inside a SCOPE statement or at the left side of an assignment.


Leaves( [ Dimension_expression ] )
Dimension_Expression

A valid Multidimensional Expressions (MDX) expression that returns a dimension.

Leaf members are tuples that are formed by the cross join of the lowest level of all attribute hierarchies. Calculated members are excluded.

  • If a dimension name is specified, the Leaves function returns a set that contains the leaf members of the key attribute for the specified dimension.
  • If a dimension name is not specified, the function returns a set that contains the leaf members of the entire cube.
ms144804.note(en-US,SQL.90).gifNote:
If the dimension expression resolves to a hierarchy, and the hierarchy unique name is the same as the dimension unique name (cube dimension property HierarchyUniqueNameStyle=ExcludeDimensionName, and the hierarchy name=dimension name), then the dimension is used.

ms144804.note(en-US,SQL.90).gifImportant:
An error is generated if not all attributes have same granularity on measure groups in current scope.

Release History

17 July 2006

Changed content:
  • Updated syntax and arguments to improve clarity.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.