Returns the set, extracting from all tuples the hierarchy specified.
In our example, the function removes from the tuple the member of the [Geography].[Economy] hierarchy.
Query
Extract( { ([Geography].[Geo].[Canada],[Geography].[Economy].[Canada])}, [Geography].[Geo] )
Result
{
[Geography].[Geo].[Country].[Canada]
}
Assertion : MDX Equals
{[Geography].[Geo].[Canada]}
Returns the set, extracting from all tuples the hierarchy specified. Duplicated tuples are removed.
In our example, the function removes from the tuple the member of the [Geography].[Economy] hierarchy.
Query
Extract( { ([Geography].[Geo].[Canada],[Geography].[Economy].[Canada])}+{([Geography].[Geo].[Canada],[Geography].[Economy].[Canada])}, [Geography].[Geo] )
Result
{
[Geography].[Geo].[Country].[Canada]
}
Assertion : MDX Equals
{[Geography].[Geo].[Canada]}
Extract will also works with a list of hierarchies.
Query
Extract( {([Geography].[Geo].[Canada],[Geography].[Economy].[Canada])}, [Geography].[Geo],[Geography].[Economy] )
Result
{
( [Geography].[Geo].[Country].[Canada], [Geography].[Economy].[Country].[Canada] )
}
Assertion : MDX Equals
{([Geography].[Geo].[Canada],[Geography].[Economy].[Canada])}
Returns an error if the tuples of the set do no contain the requested hierarchy.
Query
Extract( {([Geography].[Geo].[Canada],[Geography].[Economy].[Canada])}, [Time].[Calendar] )
Result
Error Code : OLAP_EXTRACT_MISSING_HIERARCHY
Error Message : Extract() : tuples/members dimensionality is missing the specified hierarchy '[Calendar(5)]'
Returns an error if the tuples of the set do no contain at least one of the requested hierarchies.
Query
Extract( {([Geography].[Geo].[Canada],[Geography].[Economy].[Canada])}, [Geography].[Geo],[Geography].[Economy],[Time].[Calendar] )
Result
Error Code : OLAP_EXTRACT_MISSING_HIERARCHY
Error Message : Extract() : tuples/members dimensionality is missing the specified hierarchy '[Calendar(5)]'