Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space DEV and version r0810

D toc

Excerpt

Generates the count of non-null rows 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, this function calculates the number of 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 COUNTA.

For a version of this function computed over a rolling window of rows, see ROLLINGCOUNTA Function.

D s lang vs sql
 

D s
snippetBasic

D lang syntax
RawWrangletrue
Typeref
showNotetrue
WrangleTextpivot value: counta(name) group:postal_code limit:1

counta(name)

Output: Returns the count of non-empty values in the name column.

D s
snippetSyntax

D lang syntax
RawWrangletrue
Typesyntax
showNotetrue
WrangleTextpivot value:counta(function_col_ref) [group:group_col_ref] [limit:limit_count]

counta(function_col_ref) [group:group_col_ref] [limit:limit_count]


ArgumentRequired?Data TypeDescription
function_col_refYstringName of column to which to apply the function

For more information on the group 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.

D s
snippetusage

Required?Data TypeExample Value
YesString (column reference)myValues

D s
snippetExamples

Example - Simple row count

Include Page
EXAMPLE - COUNT Functions
EXAMPLE - COUNT Functions

D s also
labelaggregate