The CrossJoin function returns the cross product of two sets from different dimensions. Its syntax is as follows:
CrossJoin(set,set)
The CrossJoin function takes two sets from different dimensions as input and creates a set that is a cross product of the two input sets, useful for creating symmetric reports.
To use the CrossJoin function:
Replace the braces {} from the columns axis with CrossJoin().
SELECT CrossJoin () ON COLUMNS, {} ON ROWS FROM Sample.Basic
Add two comma-separated pairs of braces as placeholders for the two set arguments you will provide to the CrossJoin function:
SELECT
CrossJoin ({}, {})
ON COLUMNS,
{}
ON ROWS
FROM Sample.Basic
In the first set, specify the Product member [100-10]. In the second set, specify the Market members [East], [West], [South], and [Central].
SELECT CrossJoin ({[100-10]}, {[East],[West],[South],[Central]}) ON COLUMNS, {} ON ROWS FROM Sample.Basic
On the row axis, use CrossJoin to cross a set of Measures members with a set containing Qtr1:
Paste the query into the MaxL Shell and run it, as described in Exercise: Running Your First Query.
When using CrossJoin, the order of arguments affects the order of tuples in the output.
Results of the query are shown in Table 113: