Skip to main content

MDX Functions

This reference section provides information on the MDX functions supported in Business Intelligence.

Also see Accessing the BI Samples.

  • %ALL (MDX) – Enables you to use a member while ignoring any ROW and COLUMN context that uses the hierarchy to which this member belongs. This function is an InterSystems extension to MDX.
  • %CELL (MDX) – Returns the value of another cell in a pivot table, by position. This function is an InterSystems extension to MDX.
  • %CELLZERO (MDX) – Returns the value of another cell in a pivot table or returns zero if that cell has no value. This function is a Business Intelligence extension to MDX.
  • %FIRST (MDX) – Returns the value of the given measure (or other numeric expression) evaluated for the first non-empty member of a set. This function is an InterSystems extension to MDX.
  • %KPI (MDX) – Returns a value from a KPI or plug-in. This function is an InterSystems extension to MDX.
  • %LABEL (MDX) – Given an MDX expression, returns the same expression with a different label for use as a row or column header. %LABEL can also specify formatting for the row or column. This function is a Business Intelligence extension to MDX.
  • %LAST (MDX) – Returns the value of the given measure (or other numeric expression) evaluated for the last non-empty member of a set. This function is an InterSystems extension to MDX.
  • %LIST (MDX) – Returns a comma-separated list of values, given a set of values. This function is an InterSystems extension to MDX and is intended for use in KPIs.
  • %LOOKUP (MDX) – Returns one value from a term list. This function is an InterSystems extension to MDX.
  • %MDX (MDX) – Executes an MDX query outside of the context of the current query and then returns a single result. This function is a Business Intelligence extension to MDX.
  • %NOT (MDX) – Enables you to exclude a single member of a given level. This function is an InterSystems extension to MDX.
  • %OR (MDX) – Enables you to combine multiple members into a single member, for efficiency and to avoid double-counting. This function is an InterSystems extension to MDX.
  • %SEARCH (MDX) – Returns a measure search expression that you can use with the WHERE and %FILTER clauses.
  • %SPACE (MDX) – Inserts a blank row or column with no label. This function is an InterSystems extension to MDX.
  • %TERMLIST (MDX) – Enables you to create a set of members based on a term list. When used with the %OR function, %TERMLIST is particularly useful for filtering. This function is an InterSystems extension to MDX.
  • %TIMERANGE (MDX) – Enables you to define a range of time members, possibly open-ended. This function is an InterSystems extension to MDX.
  • %TIMEWINDOW (MDX) – Returns a set of members of a time dimension that match the given range template.
  • %TOPMEMBERS (MDX) – Returns a set of all members of the first level in the given hierarchy. Or, given a level, it returns a set of all the members of that level. This function is an InterSystems extension to MDX.
  • AGGREGATE (MDX) – Returns the aggregate value for a given measure (or of the current measure), across all elements of a set, according to the aggregation logic of the measure.
  • ALLMEMBERS (MDX) – Returns a set of all members of the given level or hierarchy. Or returns a set of all members of the first hierarchy of a dimension. In either case, any calculated members are also returned.
  • ANCESTOR (MDX) – Returns the ancestor of the given member, within the given level.
  • AVG (MDX) – Returns the average value of a given expression (or of the current measure), across all elements of a set that have a non-null value for that expression.
  • BOTTOMCOUNT (MDX) – Sorts a set and returns a subset from its lower-valued end, given a desired element count.
  • BOTTOMPERCENT (MDX) – Sorts a set and returns a subset from its lower-valued end, given a cutoff percentage that is applied to a total across members.
  • BOTTOMSUM (MDX) – Sorts a set and returns a subset from its lower-valued end, given a cutoff value that is applied to a total across elements.
  • CHILDREN (MDX) – Returns a set that contains the children, if any, of a specified member.
  • CLOSINGPERIOD (MDX) – Returns the last descendent member of the given level, at the same level as the given member. This function is intended primarily for use with time levels.
  • COUNT (MDX) – Returns the count of elements in the given set.
  • COUSIN (MDX) – Given a reference member and a member of a higher level in the same hierarchy, this function finds the ancestor of the reference member at that higher level, determines the relative position of the reference member to that ancestor, and then returns the descendent of the higher member that has the same relative position. This function is intended primarily for use with time levels.
  • CROSSJOIN (MDX) – Returns a set of tuples formed by the cross-product of the specified sets.
  • CURRENTMEMBER (MDX) – Enables you to refer to a member programmatically within an iteration through the members of a hierarchy.
  • DESCENDANTS (MDX) – Returns the members that are the descendants of a given member, within the specified level or levels.
  • DISTINCT (MDX) – Examines a set, removes duplicate elements, and returns a set of the remaining elements.
  • EXCEPT (MDX) – Examines two sets and returns a set that consists of the elements of the first set, except for any elements that are also in the second set. This function optionally eliminates duplicates in that set.
  • FILTER (MDX) – Examines a set and returns the subset in which the given expression is true for each element. The set order is unchanged.
  • FIRSTCHILD (MDX) – Returns the first child of the given member.
  • FIRSTSIBLING (MDX) – Returns the first sibling of the given member.
  • HEAD (MDX) – Returns a subset from the start of a set, using the current order of the set.
  • HIERARCHISE (MDX) – Synonym for HIERARCHIZE.
  • HIERARCHIZE (MDX) – Given a set, returns a set that is in hierarchical order (the order specified by the hierarchy).
  • IIF (MDX) – Returns one of two values, depending on the value of a given logical expression.
  • INTERSECT (MDX) – Returns a set that consists of the elements that occur in both of the two given sets, optionally eliminating duplicates in that set.
  • ISNULL (MDX) – Evaluates a scalar MDX expression and returns either its value or an alternative value (if the value of the expression is null). This function is an InterSystems extension to MDX.
  • LAG (MDX) – Given a level member and a nonnegative integer, this function counts backward in the level and returns a previous member. The details are different for time dimensions and data dimensions.
  • LASTCHILD (MDX) – Returns the last child of the given member.
  • LASTSIBLING (MDX) – Returns the last sibling of the given member.
  • LEAD (MDX) – Given a level member and a nonnegative integer, this function counts forward in the level and returns a later member. The details are different for time dimensions and data dimensions.
  • LOG (MDX) – Returns the base-ten logarithm of the given numeric value.
  • LOOKUP (MDX) – Looks up a given key in a term list and returns a substitute string. This function enables you to perform string replacements within a query. This function is an InterSystems extension to MDX.
  • MAX (MDX) – Returns the maximum value of a given expression (or of the current measure), across all elements of a set.
  • MEDIAN (MDX) – Returns the value closest to the median value, for a given expression (or of the current measure), across all elements of a set that have a non-null value for that expression.
  • MEMBERS (MDX) – Returns a set of all members of the given level or hierarchy, not including any calculated members.
  • MIN (MDX) – Returns the minimum non-null value of a given expression (or of the current measure), across all elements of a set.
  • NEXTMEMBER (MDX) – Returns the next member of the level to which the given member belongs. The details are different for time dimensions and data dimensions.
  • NONEMPTYCROSSJOIN (MDX) – Returns a set that consists of the cross-product of the given sets, excluding any tuples that are null.
  • OPENINGPERIOD (MDX) – Returns the first descendent member of the given level, at the same level as the given member. This function is intended primarily for use with time levels.
  • ORDER (MDX) – Returns a set that is ordered as specified.
  • PARALLELPERIOD (MDX) – Given a reference member, a parent level of that member, and an integer, this function counts backward in the parent level, finds a previous member in that level, and then returns its child that has the same position as the reference member.
  • PARENT (MDX) – Returns the member that is the parent of the given member.
  • PERCENTILE (MDX) – Evaluates a given expression (or the current measure), across all elements of a set, and returns the value that is at a given percentile level.
  • PERCENTILERANK (MDX) – For a given numeric value, this function evaluates a given expression (or the current measure), across all elements of a set, and returns the percentile rank of that expression — the percentage of values that are the same or lower.
  • PERIODSTODATE (MDX) – Returns the set of child or descendent members of the given level, up to and including the given member. This function is intended primarily for use with time levels.
  • POWER (MDX) – Returns the given numeric value raised to the power of the second argument.
  • PREVMEMBER (MDX) – Returns the previous member of the level to which the given member belongs. The details are different for time dimensions and data dimensions.
  • PROPERTIES (MDX) – Returns the value of the given property, for the given member.
  • RANK (MDX) – Returns an integer that indicates the rank of the given member, within the given set.
  • ROUND (MDX) – Evaluates a numeric MDX expression and returns a rounded value. This function is an InterSystems extension to MDX.
  • SIBLINGS (MDX) – Returns a set that contains the specified member and all its siblings.
  • SQRT (MDX) – Returns the square root of the given numeric value.
  • STDDEV (MDX) – Returns the standard deviation of a given expression (or of the current measure), across all elements of a set.
  • STDDEVP (MDX) – Returns the population standard deviation of a given expression, across all elements of a set.
  • STDEV (MDX) – Synonym for STDDEV.
  • STDEVP (MDX) – Synonym for STDDEVP.
  • SUBSET (MDX) – Returns a set of elements from a given set, by position. The first member is at position 0.
  • SUM (MDX) – Returns the sum of a given expression (or of the current measure), across all elements of a set.
  • TAIL (MDX) – Returns a subset from the end of a set, using the current order of the set.
  • TOPCOUNT (MDX) – Sorts a set and returns a subset from its higher-valued end, given a desired element count.
  • TOPPERCENT (MDX) – Sorts a set and returns a subset from its higher-valued end, given a cutoff percentage that is applied to a total across set elements.
  • TOPSUM (MDX) – Sorts a set and returns a subset from its higher-valued end, given a cutoff value that is applied to a total across elements.
  • UNION (MDX) – Returns a set that consists of the elements of the two given sets, optionally eliminating duplicates.
  • VAR (MDX) – Returns the variance of a given expression (or of the current measure), across all elements of a set.
  • VARIANCE (MDX) – Synonym for VAR.
  • VARIANCEP (MDX) – Synonym for VARP.
  • VARP (MDX) – Returns the population variance of a given expression, across all elements of a set.
  • VISUALTOTALS (MDX) – Given a set of members in hierarchical order, returns that set with its visual totals. In the visual totals, the actual value for any higher-level member is replaced with the sum of the values for the children that are included in the query.
FeedbackOpens in a new tab