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 r095

D toc

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 s lang vs sql

D s
snippetBasic

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

count()

Output: Returns the count of records for the dataset.

D s
snippetSyntax

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.

D s
snippetExamples

Example - Simple row count

Source:

RowNum
Row 1
Row 2
Row 3
Row 4
Row 5

Transformation:

D trans
RawWrangletrue
p03Value'row_count'
Typestep
WrangleTextderive type:single value:count() as:'row_count'
p01NameFormula type
p01ValueSingle row formula
p02NameFormula
p02Valuecount()
p03NameNew column name
SearchTermNew formula

sourcerow_count
Row 15
Row 25
Row 35
Row 45
Row 55

D s also
labelaggregate