Generates the count of rows in the dataset. Generated value is of Integer type.
NOTE: When added to a transform, the COUNT
function calculates the number of rows displayed in the current sample and are not applied to the entire dataset until you run the job. If you change your sample or run the job, the computed values for this function are updated. Transforms that change the number of rows in subsequent recipe steps do not affect the value for the already computed instance of COUNT
.
Basic Usage
pivot value: COUNT() group:postal_code limit:1
Output: Generates a two-column table containing the unique values for postal_code
and the count of records for that postal_code
value. The limit
parameter defines the maximum number of output columns.
Syntax and Arguments
There are no arguments for this function.
For more information on the group
and limit
parameters, see Pivot Transform.
Tip: For additional examples, see Common Tasks.
Examples
Example - Simple row count
Source:
RowNum |
---|
Row 1 |
Row 2 |
Row 3 |
Row 4 |
Row 5 |
Transform:
derive type:single value:COUNT() as:'row_count'
source | row_count |
---|---|
Row 1 | 5 |
Row 2 | 5 |
Row 3 | 5 |
Row 4 | 5 |
Row 5 | 5 |
This page has no comments.