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

Groupers

The groupers this instance offers: what each is for, the questions it answers and when to reach for something else. Operators are sorted by name; each name links to its detail block below.

OperatorIn plain wordsAnswers questions likeLevelInstead, when…
GROUP_CATEGORYSplits the rows into one group per distinct value of a field, such as one group per region or per answer option.What is the average spend in each region?basicGROUP_RANGE when the field is a number you want in bands, not one group per value.
GROUP_DATE when the field is a date and you want months or quarters.
GROUP_SET_PER_ELEMENT when the field is a multi-select answer.
GROUP_DATESplits the rows by calendar period of a date, such as month, quarter, ISO week or weekday, to see a measure over time.How many orders came in each month?basicGROUP_DATE_RANGES when your periods are custom, such as campaign windows.
OVERLAY_INDEX_VS_PRIOR when you want each period against the one before it.
WIN_RUNNING_SUM when you want a running total down the periods.
GROUP_DATE_RANGESLabels each row with the named date range its date falls in, such as custom fiscal quarters or before and after a launch.How did sales compare before, during and after the campaign?basicGROUP_DATE when plain calendar months, quarters or weeks are enough.
FILTER_DATE_RANGES when you want to keep only the rows inside the ranges.
GROUP_KMEANSFinds k segments of rows that are alike across several numbers at once, such as customer types by spend, visits and tenure.What natural customer segments do spend, visits and tenure suggest?advancedGROUP_CATEGORY when you already know the groups.
GROUP_QUANTILE when you want bands of one number.
ATTR_MAHALANOBIS when you want how unusual each row is.
GROUP_QUANTILESplits the rows into equal-sized groups by rank of a number, such as quartiles or deciles of spend, to compare top and bottom.How do the top 25% of spenders differ from the bottom 25%?intermediateGROUP_RANGE when you want bands of a fixed width, such as every 10 years of age.
ATTR_PERCENTILE when you want each row’s rank as a number, not a group.
AGG_PERCENTILE when you want the cut-off values themselves.
GROUP_RANGESplits a number into bands of equal width, such as ages 20-30 and 30-40, to see how values spread or to compare bands.How many customers fall in each 10-year age band?basicGROUP_QUANTILE when you want groups of equal size rather than equal width.
GROUP_ROUNDED when you want each band named by its lower edge alone.
FILTER_RANGE when you want to keep one band, not split into all of them.
GROUP_ROUNDEDGroups a number by rounding it down to a multiple of a step, such as 23 and 27 both to 20, naming each group by that multiple.How many orders are there at each price point, to the nearest lower 10?basicGROUP_RANGE when you want the band’s both edges in its name.
GROUP_QUANTILE when you want groups of equal size.
GROUP_SET_PER_ELEMENTSplits a multi-select answer into one group per option, counting each row once in every option it picked.How many respondents picked each brand they are aware of?intermediateGROUP_SET_VALUE when you want each exact combination of options as one group.
AGG_SET_FREQUENCY when you only want the count per option, without other figures.
GROUP_SET_VALUEGroups the rows by the exact combination of options picked in a multi-select answer, such as A only, A and B, or none.Which combinations of payment methods do customers use, and how common is each?intermediateGROUP_SET_PER_ELEMENT when you want one group per option, counting a row in each it picked.
FILTER_SET_EQUALS when you want to keep one combination rather than see them all.

Operators

GROUP_CATEGORY

Splits the rows into one group per distinct value of a field, such as one group per region or per answer option.

Level: basic

Questions it answers:

  • What is the average spend in each region?
  • How many respondents chose each answer?

Use cases by domain:

  • survey: Satisfaction score by age band or by brand.
  • ops: Orders and revenue per store.
  • science: Mean reading per treatment arm.

Assumptions:

  • Buckets are built from the rows the filters kept; each aggregation is then worked out once per bucket.
  • A row whose field is missing lands in no bucket; it is counted as missing, not as a bucket of its own.
  • Groups appear in alphabetical order unless an include list names them, which also sets their order and drops the rest.
  • A field with very many distinct values makes very many groups; narrow it with a filter first.

Use something else:

  • GROUP_RANGE when the field is a number you want in bands, not one group per value.
  • GROUP_DATE when the field is a date and you want months or quarters.
  • GROUP_SET_PER_ELEMENT when the field is a multi-select answer.

Glossary: missing-value

Skill: op-group-category

GROUP_DATE

Splits the rows by calendar period of a date, such as month, quarter, ISO week or weekday, to see a measure over time.

Level: basic

Questions it answers:

  • How many orders came in each month?
  • Which day of the week gets the most complaints?

Use cases by domain:

  • survey: Satisfaction by fieldwork month.
  • ops: Weekly order volume, or revenue by fiscal quarter.
  • science: Daily count of observations.

Assumptions:

  • Buckets are built from the rows the filters kept; each aggregation is then worked out once per bucket.
  • Named with no period it groups by month; picked by default for a date field with no grouper type, it groups by day.
  • Weeks are ISO weeks, Monday to Sunday, numbered within the ISO year.
  • A fiscal offset applies to years and quarters only; a fiscal year is named for the calendar year it ends in.
  • A date-and-time field is grouped by the day it falls on.
  • Only buckets that hold at least one row appear; an empty band or period is left out, not shown as zero.
  • A row whose field is missing lands in no bucket; it is counted as missing, not as a bucket of its own.

Use something else:

Glossary: missing-value

Skill: op-group-date

GROUP_DATE_RANGES

Labels each row with the named date range its date falls in, such as custom fiscal quarters or before and after a launch.

Level: basic

Questions it answers:

  • How did sales compare before, during and after the campaign?
  • What are the totals for each of our custom fiscal quarters?

Use cases by domain:

  • survey: Scores per fieldwork wave, where waves have irregular dates.
  • ops: Revenue per promotion period.

Assumptions:

  • Buckets are built from the rows the filters kept; each aggregation is then worked out once per bucket.
  • Both ends of each range are inclusive; the ranges may not overlap.
  • A row outside every range goes to an unmatched group (named “unmatched” unless you rename it), not dropped.
  • A date-and-time field is matched by the day it falls on.
  • A row whose field is missing lands in no bucket; it is counted as missing, not as a bucket of its own.

Use something else:

  • GROUP_DATE when plain calendar months, quarters or weeks are enough.
  • FILTER_DATE_RANGES when you want to keep only the rows inside the ranges.

Glossary: missing-value

Skill: op-group-date-ranges

GROUP_KMEANS

Finds k segments of rows that are alike across several numbers at once, such as customer types by spend, visits and tenure.

Level: advanced

Questions it answers:

  • What natural customer segments do spend, visits and tenure suggest?
  • Which respondent types stand out across the rating battery?

Use cases by domain:

  • survey: Attitudinal segments from a battery of ratings.
  • ops: Store or customer types from several operating figures.
  • science: Groups of samples with similar measurement profiles.

Assumptions:

  • Buckets are built from the rows the filters kept; each aggregation is then worked out once per bucket.
  • Segments are found, not given: each row joins the nearest segment centre, and the centres are chosen to keep rows close to their own.
  • Numbers are put on a common scale first by default, so no field dominates because of its units.
  • Segments are named cluster_1 to cluster_k from largest to smallest and come back in that order; the same data and seed give the same names.
  • It needs every row before it can name any segment, so it cannot stream.
  • A row missing any of the numbers lands in no segment; it is counted as missing.

Use something else:

Glossary: centroid, z-score

Skill: op-group-kmeans

GROUP_QUANTILE

Splits the rows into equal-sized groups by rank of a number, such as quartiles or deciles of spend, to compare top and bottom.

Level: intermediate

Questions it answers:

  • How do the top 25% of spenders differ from the bottom 25%?
  • What is the average basket in each decile of customer value?

Use cases by domain:

  • survey: Satisfaction by income quartile.
  • ops: Return rate by decile of order value.
  • science: Outcome by quartile of exposure.

Assumptions:

  • Buckets are built from the rows the filters kept; each aggregation is then worked out once per bucket.
  • Groups are cut by rank among the rows with a value, so each holds as close to the same count as possible; under a row weight each holds as close to the same total weight as possible, a heavy row is never split, and counts stay row counts.
  • Equal values can fall in two neighbouring groups when a cut lands among them.
  • Groups are named Q1 to Q4 for quartiles, D1 to D10 for deciles, P1 to P100 for percentiles and B1, B2 and so on otherwise; Q1 is the lowest.
  • Groups come back in text order of their names, so deciles read D1, D10, D2, … D9; sort them by number before reading a trend.
  • It needs every row before it can cut, so it cannot stream.
  • A row whose field is missing lands in no bucket; it is counted as missing, not as a bucket of its own.

Use something else:

  • GROUP_RANGE when you want bands of a fixed width, such as every 10 years of age.
  • ATTR_PERCENTILE when you want each row’s rank as a number, not a group.
  • AGG_PERCENTILE when you want the cut-off values themselves.

Glossary: percentile, rank, ties

Skill: op-group-quantile

GROUP_RANGE

Splits a number into bands of equal width, such as ages 20-30 and 30-40, to see how values spread or to compare bands.

Level: basic

Questions it answers:

  • How many customers fall in each 10-year age band?
  • What does the spread of delivery times look like in 1-hour bands?

Use cases by domain:

  • survey: Respondents per age band.
  • ops: Orders per 50-unit order-value band, as a histogram.
  • science: Count of readings per band of temperature.

Assumptions:

  • Buckets are built from the rows the filters kept; each aggregation is then worked out once per bucket.
  • Each band is named low-high and holds values from its low edge up to, but not including, its high edge.
  • Bands start at multiples of the width, counted from 0; with no width given it is 1, or 10 when picked by default for a numeric field.
  • Rows come back in text order of the band names (100-150 before 50-100); sort by the low edge and add the missing bands before charting a histogram.
  • Only buckets that hold at least one row appear; an empty band or period is left out, not shown as zero.
  • A row whose field is missing lands in no bucket; it is counted as missing, not as a bucket of its own.

Use something else:

  • GROUP_QUANTILE when you want groups of equal size rather than equal width.
  • GROUP_ROUNDED when you want each band named by its lower edge alone.
  • FILTER_RANGE when you want to keep one band, not split into all of them.

Glossary: missing-value

Skill: op-group-range

GROUP_ROUNDED

Groups a number by rounding it down to a multiple of a step, such as 23 and 27 both to 20, naming each group by that multiple.

Level: basic

Questions it answers:

  • How many orders are there at each price point, to the nearest lower 10?
  • What is the count of scores in each block of 5 points?

Use cases by domain:

  • survey: Respondents per 5-point block of a 0-100 score.
  • ops: Orders per 10-unit price step, keyed by the step’s start.
  • science: Readings binned to a whole-number step.

Assumptions:

  • Buckets are built from the rows the filters kept; each aggregation is then worked out once per bucket.
  • Values are rounded down, not to the nearest: 19 with a step of 10 goes to 10, and -3 goes to -10.
  • It makes the same groups as equal-width bands of the same step; only the names differ.
  • Only buckets that hold at least one row appear; an empty band or period is left out, not shown as zero.
  • A row whose field is missing lands in no bucket; it is counted as missing, not as a bucket of its own.

Use something else:

Glossary: missing-value

Skill: op-group-rounded

GROUP_SET_PER_ELEMENT

Splits a multi-select answer into one group per option, counting each row once in every option it picked.

Level: intermediate

Questions it answers:

  • How many respondents picked each brand they are aware of?
  • What is the average rating among users of each feature?

Use cases by domain:

  • survey: Awareness count per brand from a pick-all-that-apply question.
  • ops: Tickets per tag, where a ticket can carry several tags.

Assumptions:

  • Buckets are built from the rows the filters kept; each aggregation is then worked out once per bucket.
  • A row that picked three options is counted in three groups, so group counts add up to more than the number of rows.
  • A row that picked nothing lands in no group, and neither does a missing answer.

Use something else:

  • GROUP_SET_VALUE when you want each exact combination of options as one group.
  • AGG_SET_FREQUENCY when you only want the count per option, without other figures.

Glossary: missing-value

Skill: op-group-set-per-element

GROUP_SET_VALUE

Groups the rows by the exact combination of options picked in a multi-select answer, such as A only, A and B, or none.

Level: intermediate

Questions it answers:

  • Which combinations of payment methods do customers use, and how common is each?
  • How many respondents use our app only, versus our app and a competitor’s?

Use cases by domain:

  • survey: Brand-repertoire groups: which sets of brands people buy together.
  • ops: Orders per combination of add-ons.

Assumptions:

  • Buckets are built from the rows the filters kept; each aggregation is then worked out once per bucket.
  • Each row lands in exactly one group, named by its picked options joined with |.
  • A row that picked nothing gets its own group with an empty name, which differs from a missing answer.
  • A row whose field is missing lands in no bucket; it is counted as missing, not as a bucket of its own.

Use something else:

Glossary: missing-value

Skill: op-group-set-value