DeepSee MDX Reference
[Home] [Back] [Next]
InterSystems: The power behind what matters   
Class Reference   

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)
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 in the Advanced DeepSee Modeling Guide.
For example, suppose that for HoleFoods, we have a term list named MyCities that is defined as follows:
Suppose that this term list has the following Pattern expression:
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:
{[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