Documentation

    Hosted installer: at launch

    Tables and metrics

    All reference topics

    Tables and metrics

    YAML
    # table
    data:
      inline:
        - month: Jan
          revenue: 100
        - month: Feb
          revenue: 140
    columns:
      - key: month
        label: Month
      - key: revenue
        label: Revenue
        format: number
        unit: $
        align: right
    sort: {key: revenue, dir: desc}
    max_rows: 20
    total: true
    

    Use a tagged table YAML fence for structured table authoring. Its fields are generated below. See the readability comparison for the pending series proposal; it is not part of this contract. Tables require data; columns is optional and otherwise derives from the first row. Columns accept string key, label, format and align: left|center|right. Source sorting accepts asc|desc, defaulting to asc. max_rows defaults to 20 and must be a positive integer; total defaults to false. Native details exposes remaining rows; header-click sorting uses the Rust browser runtime and the same core table operation.

    FieldTypeRequiredDefaultMeaning
    titletextA caption above the table, also its accessible name.
    datadata sourceyesThe table’s data; exactly one local source is allowed.
    data.inlinelist of mappingRows written in the block, each a mapping of column to value.
    data.csvreport-folder fileA CSV file inside the report folder.
    data.jsonreport-folder fileA JSON file of row mappings inside the report folder.
    data.urlhttp or https addressAn https data source; current native and browser hosts do not load this field.
    data.sqlmappingA SQL query run through a named connector on a host that has a registry.
    data.sql.connectortextyesThe name of the connector that runs the query.
    data.sql.queryreport-folder fileA report-relative file holding the SQL; set this or inline, not both.
    data.sql.inlinetextThe SQL text itself; set this or query, not both.
    data.metricflowmappingA MetricFlow query run through a named connector.
    data.metricflow.connectortextyesThe name of the connector that runs the query.
    data.metricflow.metricslist of textyesThe metric names to query; at least one.
    data.cachemappingA reference to a cached connector result.
    data.cache.keytextyesThe key of the cached result.
    data.sql.paramsmappingNamed values passed to the query.
    data.sql.cachemappingHow long the query’s result is reused.
    data.sql.cache.keytextThe key of the cached result.
    data.sql.cache.ttltextHow long the result stays fresh, such as 1h.
    data.sql.cache.freshnesstextA freshness rule for the result.
    data.sql.cache.refreshtrue or falseWhether every run refreshes the result.
    data.metricflow.group_bylist of textThe dimensions to group by.
    data.metricflow.wherelist of textFilters on the query.
    data.metricflow.order_bylist of textThe order of the rows.
    data.metricflow.limitwhole numberThe most rows returned.
    data.metricflow.cachemappingHow long the query’s result is reused.
    data.metricflow.cache.keytextThe key of the cached result.
    data.metricflow.cache.ttltextHow long the result stays fresh, such as 15m.
    data.metricflow.cache.freshnesstextA freshness rule for the result.
    data.metricflow.cache.refreshtrue or falseWhether every run refreshes the result.
    data.cache.ttltextHow long the result stays fresh.
    columnslist of mappingThe columns to show, in order; all columns when omitted.
    columns[n].keycolumn nameyesThe data column this table column shows.
    columns[n].labeltextThe column heading.
    columns[n].formatone of number, number_compact, percent or yearThe number format of the column’s values.
    columns[n].unittextA unit printed with each value, by the unit rule.
    columns[n].digitswhole number of significant digits from 2 to 6Significant digits of the column’s numbers, not decimal places.
    columns[n].alignone of left, center or rightThe alignment of the column’s cells.
    sortmappingThe row order.
    sort.keycolumn nameyesThe column to sort by.
    sort.dirone of asc or descascThe sort direction.
    max_rowswhole number20The most rows shown; a positive whole number.
    totaltrue or false or list of column namefalseA total row: true sums the numeric columns that are not percentages or years, a list of columns sums those.
    widetrue or falsefalseWhether the table takes the report’s full width instead of the text measure.

    Ascending table order is numeric values, then textual values, then missing cells (null and the markers ., NA, N/A, NaN, null, none); descending reverses the values and keeps missing cells last. Within the supported numeric range, precise text retained from CSV sorts by its exact decimal value, including values that share a rounded binary64 representation. A reader who sorts by a column header orders numbers by the value each cell shows: cells that show the same value keep the table’s order, and the page carries no digit a cell does not show. Leading-zero CSV identifiers and authored inline strings remain textual. Numeric totals require numeric cells throughout the column apart from missing cells, which are left out; they include retained CSV numbers, and keep the existing binary64 calculation and selected column format.

    YAML
    # metric
    value: 4234567
    label: Q3 revenue
    format: number_compact
    unit: $
    delta: 0.18
    delta_label: vs Q2
    trend: up
    
    FieldTypeRequiredDefaultMeaning
    valuenumber or textyesThe headline number or text the block shows.
    labeltextThe caption under the value.
    unittextA unit shown with the value.
    formatone of number, number_compact, percent or yearThe number format of the value.
    deltanumberThe change since the last period, shown beside the value.
    delta_labeltextThe caption of the change.
    digitswhole number of significant digits from 2 to 6Significant digits of the value and the change.
    trendone of up, down or flatThe delta’s colour; it defaults to the sign of the delta.

    Metrics require numeric or string value. Table columns, metrics and axes share one format vocabulary, listed in the field tables; another word is block.schema. The retired currency formats become a number format plus unit: $, €, £ or ¥, and authors replace them explicitly in source. Percentages multiply fractional values by 100. Compact values use scale words in tables and metrics (12.5 thousand) and K, M and B on axes. year prints a whole number without grouping (2024, never 2,024), and total: true skips year columns as it skips percent ones. digits (2 to 6) sets the significant digits; only numeric cells of a table are formatted (identifiers such as 001 stay text). A unit ending in a currency symbol ($, US$, €, £, ¥) leads the value; any other unit follows it with the chart axis rule (68.2%, 12 users). Formatting can round displayed values without changing source data.

    A metric renders as a stat line, never a filled panel: the value with its unit in the display face at size-h1 with lining tabular figures, then the label and the signed delta at the small size. The delta carries the trend colour (trend: up and down use the up and down tokens). The style’s components.metric.style chooses the rules around the stat; knockout also sets the value in the accent.

    Was this page useful? Suggest an edit