create_analysis_block
Add a totals row that auto-generates SUM formulas for numeric fields, tracks source row changes, and stays referenceable via BLOCKREF.
Instructions
Add a block that analyses another one — a totals row, sitting directly below the table it summarises.
It is an ordinary block that declares which block it analyses, so its result is addressable like any other: BLOCKREF("<name>", "<label>", "<field>"). That is the point of it being separate — a total you can only look at is much less useful than one you can reference.
What the engine does with the declaration: it GENERATES each field's formula from it, so renaming a field of the source rebuilds the total instead of breaking it, and the total tracks the source as rows are added. Do not write the formulas yourself.
By default every number field of the source gets a SUM and everything else is left blank; pass aggregates to choose. Removing the source removes this block with it.
Read it back with describe_block: the analysis reports analyzes, the source reports analyzed_by. Never sum an analysis block alongside its source — that counts the same numbers twice.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Ref name for the new block. Defaults to "<source>_analysis". | |
| label | No | What goes in the key column, and therefore the key the result is addressed by. Defaults to "TOTAL". | |
| source | Yes | Ref name of the block to analyse. | |
| aggregates | No | Which source fields to aggregate and how. Omit to SUM every field the source declares as `number`. |