Returns the union of a number of categorical values; that is, returns the categories that are in any of the input categorical values.
One or more values.
Values in
Vals are converted to categorical values if necessary, and the return value is their union. NULL values are ignored. If a value cannot be converted to a categorical type, an error occurs. If
Vals is empty (no arguments are supplied), or all the values are NULL, the return value is NULL. This function differs from using the + operator to get the union of categorical values, by ignoring NULL values instead of giving a NULL result if any NULL values are present. It differs from the
Union function by not supporting the use of category expressions.
The following mrScriptBasic example combines the results of three categorical variables to produce a merged categorical variable.