Skip to main content
This gem runs in .

Overview

The CountRecords gem allows you to count the number of rows in a dataset in different ways. You can count all rows, count non-null values in selected columns, or count distinct non-null values in selected columns.
The gem has a corresponding interactive gem example. See Interactive gem examples to learn how to run sample pipelines for this and other gems.

Prerequisites

  • Add prophecy_basics package version 1.0.0 or higher to your project.

Input and Output

The CountRecords gem accepts the following input and output.

Parameters

Configure the CountRecords gem using the following parameters.

Count options

Choose one of the following strategies for counting records.

Example

Given a table of patient visits:
If you choose:
  • Count distinct records on Department: the result will be 2 (Cardiology, Oncology).
  • Count non-null records on Department: the result will be 3.
  • Count total number of records: the result will be 4.