Survey Tabulation > Advanced expressions > UNICOM Intelligence function library > Categorical values
 
Categorical values
Categorical values can be expressed in three different ways:
Using the numeric category values only: for example, {1,6,7}. These can be passed to any function that expects a categorical value.
Using category names only. For example:
{Tea, Coffee}
Using a ="category expression" (see Category expressions, which is a string that is a type of regular expression that selects ranges of categories and/or negated (excluded) categories. For example:
"Tea .. Coffee, ^Chocolate .. Fruit."
Because category expressions are strings, they can be used only for parameters that can accept values of type Text as well as type Categorical. These parameters are shown as type None. A parameter that accepts only a categorical type cannot accept category expressions.
When category names or expressions are passed to a parameter, the Function Library component requires an MDM document to be able to convert the names or expression to a list of category numbers, which it then passes to the function. Therefore, you can pass category names or a category expression to a parameter only when the case data is opened with an MDM document, or when a script has an open MDM document available to it.
Database questions and categorical literals
Categorical literals (categories enclosed by {}) are evaluated at parse time. Categorical expressions, supplied as string literals (enclosed by "") are evaluated at run time. Given that the categories for a database question are only known at run time, after connecting to the database, the categorical values for database questions must be supplied as categorical expressions (string literals enclosed by "").
See also
UNICOM Intelligence function library