i = count(multiple-item [where condition]);
The count function returns the number of occurrences for a repeating form or roster. During data entry, the occurrence value is updated after the postproc of the first field within a repeating form or roster is executed. If the count function is executed prior to the form or roster, it returns 0. If it is executed from a field within the form or roster, it returns the current occurrence number. If it is executed after the form or roster, it returns the total number of occurrences in the form or roster.
During batch editing, count always returns the total number of occurrences in the multiply-repeating item/record.
If a where condition is included, the function returns the number of occurrences for which the condition is true. If the where condition is not included, the count function and the noccurs function return the same result.
The function returns an integer count value.
TOTAL_PERSONS = count(PERSONS);
NUM_CHILDREN = count(PERSONS where RELATIONSHIP = 3);