Pivot

Use a pivot for a compact cross-tab with row dimensions, column dimensions, and metrics.

Key fields
visuals:
  - id: category_pivot
    type: pivot
    title: Order count by category and status
    query:
      type: pivot
      rows:
      - category
      columns:
      - status
      metrics:
      - order_count
    presentation:
      type: table
      rowHeight: 32
      showHeader: true
      striped: false

Conditional-format targets may name the visible row field or metric alias. Pivot column dimensions generate headers and are not visible target columns.

Pivots support the same expandable row hierarchies as matrices. Add presentation.hierarchy for dimension levels, parent-child accounts, or nested children. Expand/collapse changes the visible rows without rerunning the query.

API reference

Kind: grid. Renderer: tanstack. Supported result shapes: pivot_window.

FieldTypeDefaultAllowed valuesDescription
typestring—table matrix pivotSelects the tabular visual behavior.
querytabular query——Selects record fields or grouped row, column, and metric fields.
cardinalitystring—bounded exactControls whether the visual resolves an exact row count.
presentation.rowHeightintegerrequiredpositive integerSets the tabular row height.
presentation.showHeaderbooleantruetrue falseShows semantic table headers.

Accessibility. Tabular visuals expose semantic headers and virtualized rows while preserving keyboard navigation.