Generates a cross product (i.e., all combinations) between two member sets.
Query
Crossjoin( [Time].[Calendar].[2010], {[Geography].[Geo].[America],[Geography].[Geo].[Europe]} )
Result
{
( [Time].[Calendar].[Year].[2010], [Geography].[Geo].[Continent].[America] ),
( [Time].[Calendar].[Year].[2010], [Geography].[Geo].[Continent].[Europe] )
}
Assertion : MDX Equals
{ ([Time].[Calendar].[2010],[Geography].[Geo].[America]), ([Time].[Calendar].[2010],[Geography].[Geo].[Europe]) }
Crossjoin removes non existing tuples across hierarchies of the same dimension (performing an auto-exists).
In the example, we crossjoin all countries in [Geo] hierarchy with [Switzerland] from [Economy] hierarchy. The result is a single tuple with [Switzerland] in both hierarchies.
Query
Crossjoin( [Geography].[Geo].[Country].Members, [Geography].[Economy].[Country].[Switzerland])
Result
{
( [Geography].[Geo].[Country].[Switzerland], [Geography].[Economy].[Country].[Switzerland] )
}
Assertion : MDX Equals
{([Geography].[Geo].[Country].[Switzerland],[Geography].[Economy].[Country].[Switzerland])}
Assertion : MDX Equals
[Geography].[Geo].[Country].Members * {[Geography].[Economy].[Country].[Switzerland]}
The crossjoin function can be applied to more than two sets.
Query
Crossjoin( [Geography].[Geo].[Country].Members, [Geography].[Economy].[Country].[Switzerland], {[Time].[Calendar].[2010],[Time].[Calendar].[2011]} )
Result
{
( [Geography].[Geo].[Country].[Switzerland], [Geography].[Economy].[Country].[Switzerland], [Time].[Calendar].[Year].[2010] ),
( [Geography].[Geo].[Country].[Switzerland], [Geography].[Economy].[Country].[Switzerland], [Time].[Calendar].[Year].[2011] )
}
Assertion : MDX Equals
[Geography].[Geo].[Country].Members * {[Geography].[Economy].[Country].[Switzerland]} * {[Time].[Calendar].[2010],[Time].[Calendar].[2011]}
Crossjoin a set with an empty (or null) set will create an empty set.
Query
Crossjoin( [Geography].[Geo].[Country].Members, {} )
Result
Assertion : MDX Equals
Crossjoin( [Geography].[Geo].[Country].Members, NULL )
An error is returned if both sets share at least one hierarchy if icCube.xml option 'dimensionalityCheck' is set to true.
Query
Crossjoin( {[Time].[Calendar].[2010]}, {[Time].[Calendar].[2011]} )
Overridden XMLA Properties
Result