Returns the cross product of the specified sets.
Parameters
Return
set
Description
Returns a list of tuples as a result of the cross product of the specified sets. For each combination a tuple is created as the sum of the tuple/items of the different sets.
{a,b,c} x {1,2} = {(a,1), (b,1), (c,1),(a,2), (b,2), (c,2)}
where {a,b,c} and {1,2} are members of two different hierarchies.
The sets have to be of different dimensionality (e.g. the crossjoin of members of the same hierarchy will return an error).
Please note that crossjoin does not produce non existing tuples into the resulting set. It also cares about the order of tuples in the resulting set (using the order of sets being cross-joined).
See Also
Extract Except Intersect Union
Examples
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].[Year].[2010], [Geography].[Geo].[Continent].[America] ),
( [Time].[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].[Year].[2010] ),
( [Geography].[Geo].[Country].[Switzerland], [Geography].[Economy].[Country].[Switzerland], [Time].[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.
Query
Crossjoin( {[Time].[Calendar].[2010]}, {[Time].[Calendar].[2011]} )
Result
Special Examples (errors, null, ...)
Crossjoin of a single set generates an error.
Query
Crossjoin( [Geography].[Geo].[Country].Members )
Result
Returns an error if applied to an invalid type.
Query
Result
XMLA Properties
Find here the value of the XMLA properties when not specified otherwise.
icCube OLAP version: 2.5.1 13-May-2012 02:21:10 GMT