Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

name: op-agg-frequency
description: Value count — how many non-null rows hold one chosen value (params.value); one float64 per output row.
kind: operator
category: AGG
operator: AGG_FREQUENCY
type: reference
applies_to: process, compose, predict
examples_tags: [cross-tabulation, streaming-friendly]

Use when

How many rows hold one chosen value of a field, such as the Yes answers, over all rows or per group.

Questions it answers:

  • How many respondents answered Yes in each region?
  • How many orders were returned each day?

Use something else:

  • AGG_MODE_COUNT when you want how many rows share the field’s most common value, whatever it is.
  • FILTER_INCLUDE when you want rows holding any of several values: keep them, then count rows.

Params

NameTypeDefaultDescription
valuestring(required)Matched like an include filter: category label, else a number (date days, datetime seconds, packed_bool 1/0)

Weight-aware ("weight": null opts out): Σw of matches (a float); share = Σw_match/Σw.

Inputs

ParamAccepted field types
Fieldany type EXCEPT set_*

Output

Scalar float64 — rows equal to value, per group.

Components

Weighted: floor adds sum_weights/n_eff/n_weight_invalid.

Universal floor {n, n_null} plus operator-specific:

KeyTypeNotes
match_countintRows equal to value (= scalar; weighted: Σw)
sharefloat64match_count / n; omitted when n is 0
  • Mergeability: Mergeable (counters sum); ProcessChain admits it

Gotchas

  • Missing value → PROCESSING_CONFIG (runtime and predict).
  • A value no row holds counts 0, not an error.
  • Nulls: not counted, not in share’s base.
  • set_* rejected with PROCESSING_CONFIG.

See