Scripting > UNICOM Intelligence Function Library > Categorical functions > AnswerCount
 
AnswerCount
Returns the number of categories selected in a category list.
Syntax
AnswerCount(Val)
Parameters
Val
Type: Categorical
Categorical value.
(return)
Type: Long
Number of categories in Val.
Remarks
If the current value is NULL, Val 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
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
For a mrScriptBasic example, see Sub.
See also
Categorical functions