r_valcnt(C;S)
Returns the number of columns that have valid (non-N/A) values across a given set of columns.
Function type
Vector only
Syntax
r_valcnt(C;S)
Input
| Argument | Type | Description |
|---|---|---|
C |
any | A space- or comma-separated list of column names
If |
S |
integer | A boolean column or an expression in
rcv_/rcn_/rct_ which determines
whether or not that column is selected to be included in the calculation. See System variables for more information about
rcv_/rcn_/rct_.If
|
Return Value
For each row of the table,
r_valcnt returns an integer value corresponding
to the number of columns in C that have valid (non-N/A) values.Note: For
columns containing text values, an empty string is not considered an N/A value, and is
therefore counted as a valid value by
r_valcnt.Sample Usage
c1 |
c2 |
c3 |
c4 |
c5 |
r_valcnt(;) |
r_valcnt(c1 c2;) |
|---|---|---|---|---|---|---|
| 2 | 5 | 7 | 2 | larry | 5 | 2 |
| 7 | 7 | 4 | 1 | moe | 5 | 2 |
| NA | 0 | 9 | 3 | curly | 4 | 1 |
| NA | NA | NA | NA | 1 | 0 |
