Scripting > UNICOM Intelligence Function Library > Categorical functions > GetAnswer
 
GetAnswer
Returns a specified category in a category list.
Syntax
GetAnswer(Val, Index)
Parameters
Val
Type: Categorical
Categorical value.
Index
Type: Long
Position of category to retrieve from Val, starting from 0.
(return)
Type: Categorical
The category at the requested position in Val, if found, or an empty Categorical value if it is not found.
Remarks
If the current value is NULL, Val is an empty Categorical value ({}) and the return value is also an empty Categorical value.
Examples
Function call
Q1
Index
Result
GetAnswer(Q1, Index)
{5,1,6,3,2,4}
0
{5}
Q1.GetAnswer(Index)
{5,1,6,3,2,4}
3
{3}
The following example tests whether the Fossils category is in the first position in the list of responses stored for each respondent in the remember multiple response variable:
remember.GetAnswer(0) = {FOSSILS}
For an example on using GetAnswer in SQL queries, see I want to use the Data Model to access data, but I am used to SPSS-style data. Can you give me an overview?.
See also
Categorical functions