---
title: "Count rows and columns in Strata | Oplema"
description: "Count the rows, columns or both in a table with Count Dataset in Strata. The result is a one-row table, and rows with missing values are counted too."
url: "https://oplema.com/docs/strata/transform/count-dataset"
updated: "2026-11-04"
---

# Count Dataset

Count the rows, the columns or both in a table. The result is one row you can check, to confirm that a step kept the number of rows or columns you expect.

**Learn this in context:** [Total rows by group and prove the total is right](https://oplema.com/learn/export-to-report/total-and-prove) (Build a report from a CSV export); [Combine CSV files when a column has been renamed](https://oplema.com/learn/many-sources/combine-files-with-renamed-columns) (Combine and reconcile data files)

## Count a small table

Manual Input has five people with two columns: name and score. Count Dataset starts with Both selected and produces one row showing rows = 5 and columns = 2.

Result
| rows | columns |
| --- | --- |
| 5 | 2 |

1. Choose `Rows` in Count. The output has just the rows column with a value of 5.
2. Choose `Columns` in Count. The output now has just the columns column with a value of 2.
3. Choose `Both` in Count to see the two counts together again.

## When to use

Use Count Dataset to check a table's size, for example to confirm that a Join didn't add or lose rows.

## Read the output

With **Both** selected, the output contains one row with `rows` set to `5` and `columns` set to `2`. Those values describe the table supplied by Manual Input.

The `name` and `score` columns are replaced by the counts in this block's output. The original input table is unchanged. Choosing Rows or Columns changes which count you get. There's always one output row.

## Read preview counts correctly

This example is small enough for all five rows to be included in the preview. With a preview row limit selected, the editor works with sampled upstream data, so a preview row count may be smaller than the full input.

Run the full flow to count every row reaching Count Dataset. The column count comes from the input schema, so it counts columns rather than filled cells.

To count rows separately for each group, use [Summarize](https://oplema.com/docs/strata/transform/summarize).

## Inputs and outputs

### Inputs

1 port

**In Required**

Accepts: Tables, Geospatial data.

Accepts one connection on this port.

### Outputs

1 port

**Out**

## Configure the block

Choose which dimensions of the input table to count.

**Count**

Rows produces a rows column; Columns produces a columns column; Both includes both counts. The output always contains one row. Row count in preview is based on the selected upstream preview sample. Full run counts every row. Default: Both.

## Count Dataset FAQs

**Do rows with missing values count?**

Yes. Every input row counts, including Noor's row with a NULL score. The row count is 5, not 4. Columns also count even if every value in them is NULL.

**What happens with an empty input table?**

Count Dataset still produces one output row. The row count is 0, and the column count is the number of columns in the input table.

**Does Count Dataset count distinct values?**

No. Duplicate rows count separately. Count Dataset measures the table's row and column counts, not the number of unique values.

**Why is the output preview only one row?**

That row holds the counts. The rows column gives the number of input rows. The preview's own row count describes the one-row result.

### Prepare your data. Build it in Strata.

Strata opens in your browser, with no account.

[Open Strata](https://oplema.com/editor?path=%2F%3Fopen%3Dstrata) [About Strata](https://oplema.com/strata)
