Scripting > UNICOM Intelligence Function Library > Categorical functions > DefinedFactors
 
DefinedFactors
Returns a set of factor numbers as defined on the categories in a variable.
Syntax
DefinedFactors(Val [, Answers])
Parameters
Val
Type: Categorical
Categorical value, used only to specify which MDM object to use.
Answers
Type: None
Optional. Variant value of type Categorical or Text, specifying a set of categories to look for. If omitted, all categories from the object are used.
(return)
Type: Categorical
Set of factor numbers as defined in on the categories, matching the order of the categories in Answers.
Remarks
Val may refer to any type of MDM object that has elements, for example, Field, Array, Grid or VariableInstance, or it may be an Elements list itself.
If Answers is of type Text, it is assumed to be a category expression and is resolved to a list of categories. If Answers is of type Categorical and contains category names, they are converted to category numbers.
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 function returns a factor of 0 for sublists and for categories with no factor defined. Factors can be long or double values.
To sort the returned values, use SortAsc or SortDesc.
See also
Categorical functions