Create offline cube files (.cub) with OlapCube. Download Now!

table of contents


Returns a set generated by the union of two sets, optionally retaining duplicate members.


Union(«Set1», «Set2»[, ALL])

Alternate Syntax 1

{«Set1», «Set2»}

Alternate Syntax 2

«Set1» + «Set 2»


This function returns the union of «Set1» and «Set2», eliminating duplicates by default. The ALL flag keeps duplicates in the joined set. Duplicates are deleted from the tail.

You can also join by union using either a comma-separated list of sets within braces or the + operator. For example:

{USA.Children, CANADA.Children}


{USA.Children} + {CANADA.Children}

are equivalent to

Union(USA.Children, CANADA.Children, ALL)

Duplicated members are always retained when an alternate syntax is used.

Note  This alternate syntax is a Microsoft® SQL Server™ 2000 Analysis Services extension to Multidimensional Expressions (MDX) in OLE DB.