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: Union
Category: Set
Description: The Union function returns the union of two sets and removes duplicate members if they exist.
Syntax: UNION( «Set1», «Set2»[, ALL] )
Technet Link: MDX Union Function




The following query combines the children of August 2003 and children of August 2004.
 

SELECT
      {} ON COLUMNS,
      UNION([Date].[Calendar].[Month].[August 2003].Children, [Date].[Calendar].[Month].[August 2004].Children) ON ROWS
FROM
      [Adventure Works]
 
 

 
You can achieve the same result by using the + (plus sign) operator as shown below.
 

SELECT
      {} ON COLUMNS,
      {[Date].[Calendar].[Month].[August 2003].Children} + {[Date].[Calendar].[Month].[August 2004].Children} ON ROWS
FROM
      [Adventure Works]
 
 

 
 

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