Shape · Rows

Densify

Adds the rows that are missing so every key combination appears, taken from the data or from a reference table you wire in, and fills the gaps with values you choose. For example, every product for every month, with 0 sales where none were recorded.

Also known as: Complete, fill gaps

How it works

Key columns are the columns whose every combination should exist. Grid source builds that grid from Observed values, the cross product of the distinct values of each key in the data, or from a Reference table wired into the spine input, such as a Generate Series of dates. The data is joined onto the grid, and each row of Fill (defaults for added rows) names a column and the value the added rows get; columns without a fill stay NULL. In Reference mode the node does not run until the spine is wired.

Inputs and outputs

Inputs

  • data — Table
  • spine — Table

Outputs

  • data — Table

Settings

The Attributes panel of Densify, as in the app: the controls work, but nothing runs — there is no data behind it.

The same settings, as the Assistant writes them
{
  keyColumns: string[]
  source: "observed" | "reference"
  fill: [{ column: string, value: string }]
}

observed = cross-product of distinct key values; reference = the spine (2nd) input

Example

Every product for every month, with 0 where nothing sold: Key columns product and month, Grid source Observed, Fill units = 0.

productmonthunits
A2026-0112
A2026-020 (added)
B2026-010 (added)
B2026-025