Scripting > UNICOM Intelligence Function Library > Categorical functions > DefinedListElements
 
DefinedListElements
Returns a set of elements of a categorical variable.
Syntax
DefinedListElements(Val, Answers [, Types])
Parameters
Val
Type: None
Variant value, used only to specify which MDM object to use.
Answers
Type: None
Text or Categorical value specifying element lists in Val.
Types
Type: Long
Optional. Flags specifying which types of Element objects to include. Default is (Category + Base).
The possible values for Types are shown in the following table.
Value
Description
1
Category elements
2
Base elements
4
Subtotal elements
8
Summary data elements
16
Derived elements
32
Subheading elements
These values may be used in any combination, to select elements of more than one type. For example, to select all Category and Base elements, use 1 + 2 = 3.
(return)
Type: Categorical
Element numbers from the specified lists.
Remarks
Val may refer to any type of MDM object that has elements, for example, Field, Array, Grid or VariableInstance.
If Answers is of type Text, it is assumed to be a category expression, except that it only applies to category lists (Elements objects in MDM), and is resolved to a list of lists. (It may contain both names of Elements objects and their numeric values.) If Answers is of type Categorical, only lists with the same value as the categories in Answers are used. If Answers is NULL, all lists in Val are used. If Answers is of any other type, an error occurs.
This function requires the case data to be opened with an MDM document or for a script to have an open MDM document available to it. Otherwise, an error will occur. For more information about opening a MDM document in a script, see Value resolution.
The return value is the union of the elements from the selected lists, including elements from any sublists they contain. Any list name or value that is not found among Val's elements is silently ignored (with no error reported).
See also
Categorical functions