MDX Functions that Return a Set

The following categories of functions return a set or a set value expression.

Pure Set Functions

Functions in this category derive their results without getting any further information from the cube.

FunctionResult
CrossJoinReturns a cross-section of two sets from different dimensions.
DistinctDeletes duplicate tuples from a set.
ExceptReturns a subset containing the differences between two sets.
GenerateFor each tuple in set1, return set2.
HeadReturns the first n members or tuples present in a set.
IntersectReturns the intersection of two input sets.
SubsetReturns a subset from a set, in which the subset is a numerically specified range of tuples.
TailReturns the last n members or tuples present in a set.
TupleRangeReturns the range of tuples between (and inclusive of) two tuples at the same level.
UnionReturns the union of two input sets.

Metadata-based Set Functions

Functions in this category derive their results using metadata information from the cube.

FunctionResult
AncestorsReturns a set of ancestors up to a specified layer or distance.
AttributeReturns all base members that are associated with the specified attribute member.
ChildrenReturns all child members of the input member.
DescendantsReturns the set of descendants of a member at specified layers.
DrilldownByLayerDrills down members of a set that are at a specified layer.
DrilldownMemberDrills down on any members or tuples of <set1> that are also found in <set2>.
DrillupByLayerDrills up the members of a set that are below a specified layer.
DrillupMemberTests two sets for common ancestors, and drills up members in the first set to the layer of the ancestors which are present in the second set.
ExtractReturns a subset containing only the tuples of a specified dimensionality.
HierarchizeSorts members according to the default member ordering as represented in the database outline.
LastPeriodsReturns a set of members ending either at the specified member or at the current member in the time dimension.
MemberRangeReturns the range of members positioned between two input members (inclusive) at the same generation or level.
MembersReturns a set of all members of a given dimension, hierarchy, or layer.
PeriodsToDateReturns a set of dynamic-time-series members from the beginning of a given layer up to a given member in that layer (or up to the default member); or, returns members up to the current member of the Time dimension.
RelMemberRangeReturns a set based on the relative position of the specified member.
SiblingsReturns the siblings of the input member.
UdaReturns all members that share a specified user-defined attribute.
WithAttrReturns all base members that are associated with an attribute member of the specified type.
AttributeExGiven the varying attribute member and the perspective setting, returns the associated base member list.
WithAttrExGiven the varying attribute dimension, condition, predicate, and perspective setting, returns the base member list satisfying the predicate.
xTDFunctions returning period-to-date values.

Data-based Set Functions

Functions in this category derive their results using data values from the cube.

FunctionResult
BottomCountReturns a set of n elements ordered from smallest to largest, optionally based on an evaluation.
BottomPercentReturns the smallest possible subset, with elements listed from smallest to largest, of a set for which the total results of a numeric evaluation are at least a given percentage.
BottomSumReturns the smallest possible subset, with elements listed from smallest to largest, of a set for which the total results of a numeric evaluation are at least a given sum.
CasePerforms conditional expressions.
FilterReturns those parts of a set which meet the criteria of a search condition.
IIFPerforms a conditional test, and returns an appropriate numeric expression or set depending on whether the test evaluates to true or false.
LeavesReturns the set of level 0 (leaf) members that contribute to the value of the specified member.
OrderSorts members of a set in order based on an expression.
TopCountReturns a set of n elements ordered from largest to smallest, optionally based on an evaluation.
TopPercentReturns the smallest possible subset, with elements listed from largest to smallest, of a set for which the total results of a numeric evaluation are at least a given percentage.
TopSumReturns the smallest possible subset, with elements listed from largest to smallest, of a set for which the total results of a numeric evaluation are at least a given sum.