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 r0710

...

Excerpt

Generates the count of non-null values for rows in each group that meet a specific condition.

Info

NOTE: When added to a transformtransformation, this function is applied to the current sample. If you change your sample or run the job, the computed values for this function are updated. Transforms Transformations that change the number of rows in subsequent recipe steps do not affect the values computed for this step.

To perform a simple counting of non-nulls without conditionals, use the COUNTA function. See COUNTA Function.

D s lang vs sql

D s
snippetBasic

COUNTAIF
d-code-lang-syntax
RawWrangletrue
Typeref
showNotetrue
WrangleTextpivot value:
countaif(entries, entryValidation == 'Ok') group:City limit:1

countaif(entries, entryValidation == 'Ok')

Output:

...

Returns the count of non-null values in the entries

...

 column when the entryValidation value is 'Ok'

...

.

D s
snippetSyntax

:COUNTAIF
d-codelang-syntax
RawWrangletrue
Typesyntax
showNotetrue
WrangleTextpivot value
:countaif(col_ref, test_expression) [group:group_col_ref] [limit:limit_count]

countaif(col_ref, test_expression) [group:group_col_ref] [limit:limit_count]


ArgumentRequired?Data TypeDescription
col_refYstringReference to the column you wish to evaluate.
test_expressionYstringExpression that is evaluated. Must resolve to true or false

...