1. Regroup series
group repartitions rows into tables keyed by the given columns — here one table per host.
group(columns: ["host"])Typorithm · hard
Step 1 of 8 · intro card
Flux
group repartitions rows into tables keyed by chosen columns so reducers like mean() run per group. pivot then reshapes long rows into a wide table — one column per field — for tabular output.
Flux carries an implicit grouping; group(columns: ["host"]) regroups rows so each host becomes its own table, and any following reducer runs once per group.
After mean(), each host table holds one average; grouping is how you control the scope a reducer applies to.
pivot(rowKey: ["_time"], columnKey: ["_field"], valueColumn: "_value") turns long-format rows into a wide table: each distinct _field becomes a column, with _value as the cell and _time identifying the row.
group repartitions rows into tables by the given columns.
Reducers like mean() run per group after grouping.
pivot reshapes long rows into a wide, tabular result.
from(bucket: "metrics")
|> range(start: -1h)
|> group(columns: ["host"])
|> mean()
|> pivot(rowKey: ["_time"], columnKey: ["_field"], valueColumn: "_value")Connect each part of the code to the concept before you type.
group repartitions rows into tables keyed by the given columns — here one table per host.
group(columns: ["host"])mean() now runs per group, producing one average per host table.
mean()pivot reshapes long-format rows into a wide table, one column per field value.
pivot(rowKey: ["_time"], columnKey: ["_field"], valueColumn: "_value")rowKey lists the columns that identify a row; rows sharing these values merge into one.
rowKey: ["_time"]Read the concept map and follow the code breakdown.
Type the implementation, repair mistakes and work through every recall exercise.
Use the final check without hints; revisit weak concepts in short practice sessions.