N Function

Returns the number of non-null or nonmissing numeric values.

Category: Descriptive Statistics
Returned data type: DECIMAL, DOUBLE, NUMERIC

Syntax

Arguments

expression

specifies any valid expression that evaluates to a numeric value.

Requirement At least one argument is required.
Data type DECIMAL, DOUBLE, NUMERIC
See <sql-expression>
FedSQL Expressions

Details

Null values are converted to missing values and are counted as missing values.

Comparisons

The N function counts non-null and nonmissing values, whereas the NMISS function counts missing values. The N function requires numeric arguments.

Example

The following statements illustrate the N function:
Statements
Results
select n(1,0,.,2,5,.);
4
select n(1,2);
2

See Also

Functions:
Last updated: February 23, 2017