#### Count

##### Count(Number a[ ])

This function computes the number of the values in an array.

Parameter

a - A Double array.

Return value

The return value is an Integer.

Examples

- The return value of the following statement is 7.

  `Count([11.2, 15.4, 13.7, 16.9, 15.2, 14.8, 10.6])`

- The return value of the following statement is 4.

  `Count([-20.4, -26.4, -68.7, -84.1])`

##### Count(DBField a)

The function is used to count the number of values referred to by the argument.

Parameter

a - Values of DBField or formula field.

Return value

Returns a Number type value.

Examples

- `Number x = Count(@dbfield)`
- `Number x = Count(@formula)`

##### Count(DBField a, String groupby)

The function is used to count the number of values referred to by the first argument.

Parameters

- a - Values of DBField or formula field.
- groupby - A constant string to indicate the groupby DBField name, formula name grouped by or a parameter name grouped by.

Return value

Returns a Number type value.

Examples

- `Number y = Count(@"Customer Name", @Customers_Region)`
- `Number x = Count(@formula, @formula_groupby)`
- `Number x = Count(@dbfield, @parametger_groupby)`

Note: If a field is assigned to a variable, for example x, the variable x will lose the characteristic of representing a group of values. The following formula will then be treated as incorrect.

`Number x = @dbfield;
Number y = Count(x); // system will prompt you that there is no such kind of function.`