The MDX
functions
that are listed here indicate their return type.
Assuming that the levels in the Location dimension are named in a hierarchical
order, an example of levels would be All, Countries, States, Counties, and
Cities.
Ancestor Expressions and Returned Values
Expressions
|
Value Returned
|
Ancestors (USA) |
All members |
Ancestors (Wake, Counties) |
USA |
Ancestors (Wake, Counties, SELF) |
USA |
Ancestors (Wake, States, BEFORE) |
USA, All |
Ancestors (Wake, Counties, AFTER) |
Wake (includes member itself), North Carolina |
Ancestors (Raleigh, States, BEFORE_AND_AFTER) |
Raleigh, Wake, USA, All members |
Ancestors (Raleigh, States, SELF_BEFORE_AFTER) |
Raleigh, Wake, NC, USA, All members |
Ancestors (NC, Counties, Root) |
All members |
Ancestors (Wake, 1) |
North Carolina |
Ancestors (Wake, 2, SELF_BEFORE_AFTER) |
Wake, NC, USA, All members |
Ascendants |
returns all ancestors of the specified member up
through the root level, including the member itself.
Ascendants (<Member>) Example: The following example shows retrieving
the member at the specific level above and the current member dynamically
using the Ascendants function (set function).
SELECT
{Ascendants([time].[all yqm] .[2002])} ON COLUMNS ,
{Descendants([geography].[global].[all global],2)} ON ROWS
FROM [orionstar]
WHERE [measures].[total_retail_pricesum] |
Axis |
returns a set that is defined in an axis. Axis (0)
pertains to row members, where Axis (1) pertains to column members.
Axis (<Numeric Expression>) Example:
Axis (0)
Axis (1)
Note: The Axis function is not allowed in session- or
global-named sets or calculations. |
BottomCount |
returns a specified number of items from the bottom
of a set.
BottomCount(<Set>,<Count>[,Numeric Expression>[,<True|False>]])
Example: The following example shows displaying the bottom 5 products
in the Clothes product category for 2002Q4 using the BottomCount function.
SELECT
{[time].[yqm].[all yqm].[2002].[2002q4] } ON COLUMNS ,
{BottomCount([product].[all product].[clothes & shoes].[clothes].
children ,5,[measures].[total_retail_pricesum] ) } ON ROWS
FROM [orionstar]
WHERE [measures].[Total_retail_pricesum]
Note: The True|False
flag is for including duplicates. If it is set to TRUE, then any member
that has the same value as the last member will also be returned. If it is
set to FALSE, then it will work as it always did. The default value for the
flag is FALSE.
Note: Constant numeric expressions should not be entered for this function. |
BottomPercent |
sorts a set and returns the specified number of bottommost
elements whose cumulative total is at least a specified percentage.
(<Set>,<Percentage>[,<Numeric Expression>])
Example: The following example shows displaying the bottom 25% of Clothes
Items in the Product Category for 2002 using the BottomPercent function.
SELECT
{[time].[yqm].[all yqm].[2002] } ON COLUMNS ,
{BottomPercent([product].[all product].[clothes & shoes].
[clothes].children ,25,[measures].[total_retail_pricesum] )
} ON ROWS
FROM [orionstar]
WHERE [measures].[total_retail_pricesum]
Note: Constant numeric expressions should not be entered for this function. |
BottomSum |
sorts a set by using a numeric expression and returns
the specified number of
bottommost elements whose sum is at least a specified value.
(<Set>,<Value>[,<Numeric Expression>])
Example: The following example shows obtaining the items that have a
cumulative total below the specified amount using BottomSum function.
SELECT
{[time].[yqm].[all yqm].[2002] } ON COLUMNS ,
{BottomSum([product].[all product].[clothes & shoes].
[clothes].children ,6000000,[measures].[total_retail_pricesum] )
} ON ROWS
FROM [orionstar]
WHERE [measures].[total_retail_pricesum]
WHERE [measures].[total_retail_pricesum]
Note: Constant numeric expressions should not be entered for this function. |
Children
|
returns the children of a member.
<Member>.Children |
Crossjoin |
returns the cross-product of two sets.
Crossjoin(<Set1>,<Set2>) |
Descendants |
returns the set of descendants of a member to a
specified level or distance. Optionally, this includes or excludes descendants
at other levels. By default, only members at the specified level or distance
are included.
Descendants(<Member>,[<Level>[,<Desc_flags>]])
Descendants(<Member>,<Distance>[,<Desc_flags>]) |
Distinct |
returns a set by removing duplicate tuples from a
specified set. Duplicates are eliminated from the tail.
Distinct(<Set>) |
Drilldown
Level |
drills down to the members of a set one level below
the lowest level that is represented in the set, or to one level below an
optionally specified level of a member that is represented in the set.
DrilldownLevel(<Set>[,{<Level>|,<Index}])
|
Drilldown
LevelBottom |
drills down the members of a set to one level below
the lowest level that is represented in the set, or to one level below an
optionally specified level of a member that is represented in the set. However,
instead of including all children for each member at the specified <Level>,
only the bottom <Count> of children is returned, based on <Numeric Expression>.
DrilldownLevelBottom(<Set>,<Count>[,[<Level>]
[,<Numeric Expression>]])
Note: Constant numeric expressions should not be entered for this function. |
Drilldown
LevelTop |
drills down the members of a set to one level below
the lowest level that is represented in the set, or to one level below an
optionally specified level of a member that is represented in the set. However,
instead of including all children for each member at the specified <Level>,
only the top <Count> of children is returned, based on <Numeric Expression>.
DrilldownLevelTop(<Set>,<Count>[,[<Level>]
[,<Numeric Expression>]])
Note: Constant numeric expressions should not be entered for this function. |
Drilldown
Member |
drills down to the members in a specified set that
are present in a second specified set.
DrilldownMember(<Set1>,<Set2[,Recursive]) |
Drilldown
MemberBottom |
drills down to the members in a specified set that
are present in a second specified set, therefore limiting the result set to
a specified number of members.
DrilldownMemberBottom(<Set1>,<Set2>, <Count>[,
[<Numeric Expression>]
[,Recursive]])
Note: Constant numeric expressions should not be entered for this function. |
Drilldown
MemberTop |
drills to the members in a specified set that are
present in a second specified set, therefore limiting the result set to a
specified number of members.
DrilldownMemberTop(<Set1>,<Set2>, <Count>[,
[<Numeric Expression>]
[,Recursive]])
Note: Constant numeric expressions should not be entered for this function. |
DrillupLevel |
removes all members in the set that are below the
specified level. If the level is not given, then it determines the lowest
level in the set and removes all members at that level.
DrillupLevel(<Set>[,<Level>]) |
DrillupMember |
drills to the members in a specified set that are
present in a second specified set.
DrillupMember(<Set1>,<Set2>) |
Except |
locates the difference between two sets and optionally
retains duplicates.
Except(<Set1>,<Set2>[,All]) |
Extract |
returns a set of tuples from extracted dimension
elements.
Extract(<Set>,<Dimension>[,<Dimension>...]) |
Filter |
returns the set that results from filtering a specified
set that is based on a search condition.
Filter(<Set>,<Search Condition>) |
Generate |
applies a set to each member of another set and is
joined to the resulting sets.
Generate(<Set1>,<Set2>[,All]) |
Head |
returns the first specified number of elements in
a set.
Head(<Set>[,<Numeric Expression>]) |
Hierarchize |
orders the members of a set in a hierarchy.
Hierarchize(<Set>) |
Intersect |
returns the intersection of two input sets and optionally
retains duplicates.
Intersect(<Set1>,<Set2>[,All]) |
LastPeriods |
returns a set of members prior to and including a
specified member.
LastPeriods(<Index>[,<Member>]) |
Members |
returns the set of members in a dimension, level,
or hierarchy.
<Dimension>.Members
<Level>.Members
<Hierarchy>.Members |
Mtd |
returns the set of members that consist of the descendants
of the Month level ancestor of the specified member, including the specified
member itself. This function is analogous to the PeriodsToDate() function
with the level defined as Month.
Mtd([<Member>]) |
NameToSet |
returns a set that contains a single member. The
set is based on a string expression that contains a member name.
NameToSet(<Member Name>) |
NonEmpty
Crossjoin |
returns the cross-product of one or more sets as
a set. This excludes empty tuples and tuples without associated fact table
data.
NonEmptyCrossjoin(<Set1>[,<Set2>][,<Set3>...]
[,<Crossjoin Set Count>]) |
Order |
arranges members of a specified set and optionally
preserves or breaks the hierarchy.
Order(<Set>[,[<Numeric Expression>][,BASC|BDESC]])
Order(<Set>[,[<String Expression>][,BASC|BDESC]])
Order(<Set>,<Numeric Expression>[,ASC|DESC])
Order(<Set>,<String Expression>[,ASC|DESC])
Note: Constant numeric expressions should not be entered for this function. |
PeriodsToDate |
returns the set of members that consist of the descendants
of the ancestor of the specified member at the specified level, including
the specified member itself.
PeriodsToDate([<Level>[,<Member>]]) |
Qtd |
returns the set of members that consist of the descendants
of the Quarter level ancestor of the specified member, including the specified
member itself. This function is analogous to the PeriodsToDate() function
with the level defined as Quarter.
Qtd([<Member>]) |
SetToList |
takes an MDX set as input and returns a list of variable-length
parameters. Functions that take variable-length parameter lists include the
descriptive statistics functions (SUM(), MEAN(), PCTL(), etc.), COALESCE(),
and CHOOSEC/N(). In addition, it takes the character parameters CAT/S/T/X()
and COALESCEC().
Settolist(<Set>[,<Numeric Expression | Character Expression>]) |
Siblings |
returns the siblings of a specified member, including
the member itself.
<Member>.Siblings |
StripCalculated
Members |
returns a set that is generated by removing calculated
members from a specified set.
StripCalculatedMembers(<Set>) |
StrToSet |
returns a set that is constructed from a specified
string expression in Multidimensional Expressions (MDX) format.
StrToSet (<String Expression>) |
Subset |
returns a subset of tuples from a specified set.
Subset(<Set>,<Start>[,<Count>]) |
Tail |
returns a subset from the end of a set.
Tail(<Set>[,<Count>]) |
ToggleDrillState |
Toggles the drill state of members.
ToggleDrillState(<Set1>,<Set2>[,RECURSIVE])
Note: In a graphical user interface, drilling up and down is often accomplished
by double-clicking a label to expand or contract the information. Drilling
down on a member causes the member's children to be returned; drilling up
causes them to disappear from the results. |
TopCount |
returns a specified number of items from the topmost
members of a specified set.
TopCount(<Set>,<Count>[,<Numeric Expression>[,<True|False>]])
Note: The True|False flag is for including duplicates. If it
is set to TRUE, then any member that has the same value as the last member
will also be returned. If it is set to FALSE, then it will work as it always
did. The default value for the flag is FALSE.
Note: Constant numeric expressions should not be entered for this
function. |
TopPercent |
sorts a set and returns the topmost elements, whose
cumulative total is at least a specified percentage.
TopPercent(<Set>,<Percentage>[,<Numeric Expression>])
Note: Constant numeric expressions should not be entered for this function. |
TopSum |
sorts a set and returns the topmost elements whose
cumulative total is at least a specified value.
TopSum(<Set>,<Value>[,<Numeric Expression>])
Note: Constant numeric expressions should not be entered for this function. |
Union |
returns a set that is generated by the union of two
sets. Optionally, duplicate members are retained.
Union(<Set1>,<Set2>[,All]) |
VisualTotals |
returns a set that is generated by dynamically totaling
child members in a specified set. A pattern for the name of the parent member
in the result set is used.
VisualTotals (<Set>,<Pattern>) |
Wtd |
returns the set of members that consist of the descendants
of the Week level ancestor of the specified member, including the specified
member itself. This function is analogous to the PeriodsToDate() function
with the level defined as Week.
Wtd([<Member>]) |
Ytd |
returns the set of members that consist of the descendants
of the Year level ancestor of the specified member, including the specified
member itself. This function is analogous to the PeriodsToDate() function
with the level defined as Year.
Ytd([<Member>]) |