rollup
Rolls a finer period matrix up to a coarser one, detecting the input period from
its shape (no from argument).
API Reference
Signature
Parameters
Supported directions: day → month/quarter/year, month → quarter/year, quarter → year.
Returns
A fixed-shape target period matrix, keys ascending, no auto-filled gap years;
buckets with no source period or no valid value are "-".
Throws
MATRIX_INVALID_ROLLUP_OPTIONS— invalidtoor non-functionusing.MATRIX_UNRECOGNIZED_PERIOD_MATRIX— input is not a recognizable period matrix (mixed or unknown shape).MATRIX_UNSUPPORTED_ROLLUP— same-or-finer target.
Agent Contract
Agent Notes
- Do not pass
from; the input period is detected from key format + row length (see period-shapes). usingreceives only valid values (no"-"/undefined) and no context.- For the opposite direction (coarser → finer) use rolldown.