Excerpt |
---|
Generates the count of rows in the dataset. Generated value is of Integer type. |
Info |
---|
NOTE: When added to a transformation, this 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. Transformations that change the number of rows in subsequent recipe steps do not affect the value for the already computed instance of COUNT . |
D lang syntax |
---|
RawWrangle | true |
---|
Type | ref |
---|
showNote | true |
---|
WrangleText | pivot value: count() group:postal_code limit:1 |
---|
|
count() |
Output: Returns the count of records for the dataset.
There are no arguments for this function.
You can use the group
and limit
parameters to specify the scope of the count. For more information on the group
and limit
parameters, see Pivot Transform.
Example - Simple row count
Source:
RowNum |
---|
Row 1 |
Row 2 |
Row 3 |
Row 4 |
Row 5 |
Transformation:
D trans |
---|
RawWrangle | true |
---|
p03Value | 'row_count' |
---|
Type | step |
---|
WrangleText | derive type:single value:count() as:'row_count' |
---|
p01Name | Formula type |
---|
p01Value | Single row formula |
---|
p02Name | Formula |
---|
p02Value | count() |
---|
p03Name | New column name |
---|
SearchTerm | New formula |
---|
|
source | row_count |
---|
Row 1 | 5 |
Row 2 | 5 |
Row 3 | 5 |
Row 4 | 5 |
Row 5 | 5 |