Generates the count of non-null rows in a specified column,= optionally counted by group. Generated value is of Integer type.

**NOTE: **Empty string values are counted. Null values are =
not counted.

**NOTE: **When added to a transformation, this function cal=
culates the number of values in the specified column, as displayed in the c=
urrent sample. Counts are not applied to the entire dataset until you run t=
he job. If you change your sample or run the job, the computed values for t=
his function are updated. Transformations that change the number of rows in=
subsequent recipe steps do not affect the value for the already computed i=
nstance of `COUNTA`

.

For a version of this function computed over a rolling window of rows, s= ee ROLLINGCOUNTA Func= tion.

**Wrangle vs. SQL:** This function is part of Wrangle , a proprietary data transformation language.=
Wrangle is not SQL. For more information, se=
e Wrangle Language.

counta(name)

**Ou=
tput:** Returns the count of non-empty values in the `name column.`

counta(function_col_ref) [group:group_col_= ref] [limit:limit_count]

=20
=20
=20
=20
=20

Argument | Required? | Data Type | Description |
---|---|---|---|

function_col_ref | Y | string | Name of column to which to apply the function |

For more information on the `group`

parameter, see&=
nbsp;Pivot Transform.

Name of the column from which to count values based on the grouping.

- Literal values are not supported as inputs.
- Multiple columns and wildcards are not supported.

**Usage Notes:**

Required? | Data Type | Example Value |
---|---|---|

Yes | String (column reference) | `myValues` |

**Tip:** For additional examples, see Common Tasks.

This section provides simple examples for how to use the `COUNTA and `

`COUNTDISTINCT`

functions. These functions in=
clude the following:

```
```
`COUNTA`

- Count the number of values within a group th=
at meet a specific condition. See COUNTA Function.
`COUNTDISTINCT`

- Count the number of non-null values w=
ithin a group that meet a specific condition. See COUNTDISTINCT Function.

**Source:**

In the following example, the seventh row is an empty string, and the ei=
ghth row is a null value.

rowId
Val
r001
val1
r002
val1
r003
val1
r004
val2
r005
val2
r006
val3
r007
(empty)
r008
(null)

**Transformation:**

Apply a `COUNTA`

function on the source column:

=20
=20
=20
=20
=20
=20
=20
=20
=20
=20
=20
=20
=20
=20
=20
=20
=20
=20
=20
=20
Transformation Name <=
code>New formula Parameter: Formula type `Single row formula`

Parameter: Formula `COUNTA(Val)`

Parameter: New column name `'fctnCounta'`

=20
Apply a `COUNTDISTINCT`

function on the source:

=20
=20
=20
=20
=20
=20
=20
=20
=20
=20
=20
=20
=20
=20
=20
=20
=20
=20
=20
=20
Transformation Name <=
code>New formula Parameter: Formula type `Single row formula`

Parameter: Formula `COUNTDISTINCT(Val)`

Parameter: New column name `'fctnCountdistinct'`

=20
**Results:**

Below, both functions count the number of values in the column, with&nbs=
p;`COUNTDISTINCT`

counting distinct values only. The empty value=
for `r007`

is counted by both functions.

rowId
Val
fctnCountdistinct
fctnCounta
r001
val1
4
7
r002
val1
4
7
r003
val1
4
7
r004
val2
4
7
r005
val2
4
7
r006
val3
4
7
r007
(empty)
4
7
r008
(null)
4
7

=20

```
------=_Part_28730_223987614.1653453897752--
```