Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Extract (MDX)
Collapse the table of content
Expand the table of content

Extract (MDX)

Returns a set of tuples from extracted hierarchy elements.


Extract(Set_Expression, Hierarchy_Expression1 [,Hierarchy_Expression2, ...n] )

Set_Expression

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

Hierarchy_Expression1

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

Hierarchy_Expression2

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

The Extract function returns a set that consists of tuples from the extracted hierarchy elements. For each tuple in the specified set, the members of the specified hierarchies are extracted into new tuples in the result set. This function always removes duplicate tuples.

The Extract function performs the opposite action of the Crossjoin function.

Examples

The following query shows how to use the Extract function on a set of tuples returned by the NonEmpty function:

SELECT [Measures].[Internet Sales Amount] ON 0,

//Returns the distinct combinations of Customer and Date for all purchases

//of Bike Racks or Bike Stands

EXTRACT(

NONEMPTY(

[Customer].[Customer].[Customer].MEMBERS

*

[Date].[Date].[Date].MEMBERS

*

{[Product].[Product Categories].[Subcategory].&[26],[Product].[Product Categories].[Subcategory].&[27]}

*

{[Measures].[Internet Sales Amount]}

)

, [Customer].[Customer], [Date].[Date])

ON 1

FROM [Adventure Works]

Community Additions

ADD
Show:
© 2015 Microsoft