Home      Functions     Common Solutions      Contact     






MDX Functions:
 
MDX Functions

 
Common Solutions

Common Solutions
 
Resource Links

MDX Books
MDX Related Software
MDX Related Blogs
 
Other Links

Contact Us
 
Microsoft SQL Server Analysis Services Function Page
Function Name: Crossjoin
Category: Set
Description: The Crossjoin function returns the cross product of one or many sets.
Syntax: CROSSJOIN( «Set1», «Set2» )
Technet Link: MDX Crossjoin Function




The following query returns the cross product of Product Categories and Fiscal Years
 

SELECT
      CROSSJOIN([Product].[Product Categories].[Category].Members, [Date].[Fiscal].[Fiscal Year].Members) ON COLUMNS
     
FROM
      [Adventure Works]
 
 

 
The query above could be re-written using the * operator:
 

SELECT
      {[Product].[Product Categories].[Category].Members * [Date].[Fiscal].[Fiscal Year].Members} ON COLUMNS
     
FROM
      [Adventure Works]
 
 

 
The query below shows the Order Count for the cross product of Fiscal Year members, Category members from the Product dimension, and Sales Channel members.
 

SELECT
      {[Measures].[Order Count]} ON COLUMNS,
      {[Date].[Fiscal].[Fiscal Year].Members * [Product].[Product Categories].[Category].Members * [Sales Channel].[Sales Channel].Members} ON ROWS
FROM
      [Adventure Works]
 
 

 
The query below shows the Order Count for the cross product of Fiscal Year members, Category members from the Product dimension, and Sales Channel members, filtering out empty values.
 

SELECT
      {[Measures].[Order Count]} ON COLUMNS,
      NON EMPTY {[Date].[Fiscal].[Fiscal Year].Members * [Product].[Product Categories].[Category].Members * [Sales Channel].[Sales Channel].Members} ON ROWS
FROM
      [Adventure Works]
 
 

 
 

 
Copyright 2008 by MDXpert.com.
 
Terms of Use                              Privacy Statement
 
Site Powered By - WinHost.Com