Skip to main content

%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.

Returned Type

This function returns a set.

Syntax and Details

%TERMLIST(term_list_name, flag)

Where:

  • term_list_name is a string expression that evaluates to the name of a term list.

  • flag, which is optional, is either "EXCLUDE" or "INCLUDE" (the default).

This function returns a set that, by default, consists of members that are identified by the key values in the term list, in combination with the term list pattern. The term list pattern indicates the level to which the members belong, and indicates how to create the full identifiers for the members.

If you specify flag as "EXCLUDE", the set instead consists of all members of the given level except for the ones identified in the term list.

For information on defining term lists, see Defining Term Lists.

Example

For example, suppose that for HoleFoods, we have a term list named MyCities that is defined as follows:

generated description: term list example

Suppose that this term list has the following Pattern expression:

[Outlet].[H1].[City].[*]

Then for this term list, the %TERMLIST function returns a set that consists of the Atlanta, Boston, and New York members of the City level. That is, the following two expressions are equivalent:

%TERMLIST("MyCities")

And:

{[Outlet].[H1].[City].[Atlanta],[Outlet].[H1].[City].[Boston],[Outlet].[H1].[City].[New York]}

When used with the %OR function, %TERMLIST is particularly useful for filtering. For example:

SELECT FROM holefoods %FILTER %OR(%TERMLIST("MyCities"))

See Also

FeedbackOpens in a new tab