name: op-agg-set-frequency
description: Per-bit row count — how many rows had each set label selected.
kind: operator
category: AGG
operator: AGG_SET_FREQUENCY
type: reference
applies_to: process, compose, predict
examples_tags: [cardinality-analysis, cross-tabulation]
Use when
For a multi-select field, how many rows chose each option, over all rows or per group.
Questions it answers:
- How many respondents selected each brand they have heard of?
- How many customers use each payment method?
Use something else:
GROUP_CATEGORYwhen the field holds one value per row: group by it, then count.AGG_SET_DISTINCT_VALUESwhen you want how many different combinations were chosen.
Params
None. Weight-aware ("weight": null opts out): Σw per member — map values become floats.
Inputs
field — admitted types: see ## Contract.
Output
JSON object label → row count (weighted: Σw floats). Scalar fallback = max single-label frequency.
Components
-
total_label_observations— Sum of popcounts (label selections) -
distinct_labels— Distinct labels seen ≥ once -
per_label_count— Label → row count -
Margin: summable for crosstab
Contract
- Types (
field):set_*; any other scalar type isPULSE_FIELD_TYPE_UNSUPPORTED;decimal128isPULSE_AGG_NOT_MEANINGFUL_FOR_DECIMAL. - Weight: weighted under
frequencyandprobabilityweights. - Streaming: streamable; components
partial. - Components:
n,n_null,total_label_observations,distinct_labels,per_label_count; optionalsum_weights,n_eff,n_weight_invalid.
Gotchas
- Survey-friendly default (“respondents per issuer”).
- Weighted Σw figures are binned sums: the same bits on every worker count and shard split.
- As a crosstab
cellit fills each cell with that map. - Per-row a respondent may contribute to multiple bins —
total_label_observationscan exceedn. - Non-scalar row value: an overlay scoring it (request, Compose or whole-chain:
params.fieldwhere the kind honours it, elseaggregations[0]) is refused (PROCESSING_CONFIG, reasonnon_scalar), as is a chain stage carrying it that feeds another; an unscored one beside a scalar runs.
See
pulse_examples_search tags=[cardinality-analysis]- Skills:
aggregation-design,crosstab-guide,response-components