name: op-group-set-per-element
description: Fan each row into one bucket per selected label (multi-key). Cardinality multiplies with set popcount.
kind: operator
category: GROUP
operator: GROUP_SET_PER_ELEMENT
type: reference
applies_to: process, compose, predict
examples_tags: [cardinality-analysis, cohort-analysis]
Use when
Splits a multi-select answer into one group per option, counting each row once in every option it picked.
Questions it answers:
- How many respondents picked each brand they are aware of?
- What is the average rating among users of each feature?
Use something else:
GROUP_SET_VALUEwhen you want each exact combination of options as one group.AGG_SET_FREQUENCYwhen you only want the count per option, without other figures.
Params
None. The key column is named after field (a group slot takes no label); include allow-lists fan-out labels and fixes emission order.
Inputs
field — admitted types: see ## Contract.
Output
One string key per set bit per row. Smart default for set_*. Streams. Non-empty include overrides dict-index emission order; zero-record labels dropped.
Components
total_label_observations— Sum ofbuckets[].count; MAY exceedtotal_n— fan-outbuckets—{key, label, count, dict_index}- Is a fused-crosstab axis — admitted at any position, either or both axes.
Contract
- Types (
field):set_*; any other scalar type isPULSE_FIELD_TYPE_UNSUPPORTED. - Weight: not read; a weight in force is skipped.
- Streaming: streamable; components
mergeable. - Components:
total_n,n_null,total_label_observations,buckets.
Gotchas
sum(buckets[].count) > total_nis CORRECT:total_ncounts records with ≥1 label, once each;n_null= null sets + include-rejected rows.- Empty-mask rows skipped; do NOT increment
n_null. Null rows do. - A mask bit past the dictionary is corrupt data:
ENCODING_INVALID(set_member_out_of_range), never silently dropped. - Crosstab: a null or empty set reaches no cell, so no margin (column % = “% of those asked”). Margins are non-additive: 3 labels count 3× across row margins, once in the grand total.
See
pulse_examples_search tags=[cohort-analysis]- Skills:
grouper-design,crosstab-guide,op-group-set-value