Excerpt |
---|
Generates the count of distinct values in a specified column, optionally counted by group. Generated value is of Integer type. |
Info |
---|
NOTE: Empty string values are counted. Null values are not counted. |
Info |
---|
NOTE: When added to a transformation, the function calculates the number of distinct values in the specified column, as displayed in the current sample. Counts 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 COUNTDISTINCT . |
D lang syntax |
---|
RawWrangle | true |
---|
Type | ref |
---|
showNote | true |
---|
WrangleText | pivot value: countdistinct(name) group:postal_code limit:1 |
---|
|
countdistinct(name) |
Output: Returns the count of distinct values in the name
column.
D lang syntax |
---|
RawWrangle | true |
---|
Type | syntax |
---|
showNote | true |
---|
WrangleText | pivot value:countdistinct(function_col_ref) [group:group_col_ref] [limit:limit_count] |
---|
|
countdistinct(function_col_ref) [group:group_col_ref] [limit:limit_count] |
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
and limit
parameter, see Pivot Transform.
function_col_ref
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.
Required? | Data Type | Example Value |
---|
Yes | String (column reference) | myValues |
Example - Simple row count
Include Page |
---|
| EXAMPLE - COUNT Functions |
---|
| EXAMPLE - COUNT Functions |
---|
|