Developer Documentation Library > UNICOM Intelligence Function Library > Categorical functions > AnswerCount
 
AnswerCount
Returns the number of categories selected in a category list.
AnswerCount can be used with a comparison operator to select respondents who chose more than a specified number of categories in response to a multiple response question. For example, the following example could be used to select respondents who selected more than one category in response to the museums multiple response question:
museums.AnswerCount() > 1
Syntax
AnswerCount(<value>)
Parameters
<value>
Type: Categorical
Categorical value.
(return)
Type: Long
Number of categories in <value>.
Notes
If the current value is NULL, <value> is an empty Categorical value ({}) and the return value is zero.
This function is equivalent to Len with a categorical parameter.
Examples
Function call
Value
Result
Q1.AnswerCount()
{1,2,7,5,4}
5
AnswerCount(remember)
{2,6,4,8,11,7}
6
For a mrScriptBasic example, see Sub.
See also
Categorical functions