NIPO ODIN Version 5.17

*COUNT

Purpose

Counts the number of answers.

Syntax

*COUNT <Qn|numvar> <Qm>

Description

This command is also allowed under condition. The number of answers to the question specified in the second argument is counted and will be put as a number in the data field or variable specified in the first argument.

Arguments

Qn
The question reference of the data field where the number is stored.

numvar
The name of the numeric variable where the number is stored. This variable has to be defined earlier in the questionnaire.

Qm
The question reference from which the number of answers have to be counted.

Remarks

This command is only useful for multiple codes (*MULTI) questions.

Example

*QUESTION 1 *CODES 178L7 *MULTI

What brands of beer do you know?

1: Heineken
2: Amstel
3: Grolsch
4: Carlsberg
5: Tuborg
6: Other *OPEN
7: Don’t know *NMUL

*VARS numb
*COUNT numb Q1
*QUESTION 2 *CODES 185 *IF [Q1,1-6]

So you know *? numb brands of beer?

1: Yes
2: No

In this example, the number of answers on question 1 is counted in the variable numb and used in the question text of question 2.

See Also