Skip to content

Table

Tables enable you to represent data in a tabular format.

Use data for simple tables that show all columns from a model or insight. Use columns to select and rename specific columns. Add rows and values to create a pivot table.

Simple Table

tables:
  - name: revenue-table
    data: ${ref(monthly-revenue)}
    rows_per_page: 100

Column Selection

tables:
  - name: custom-table
    columns:
      - ${ref(sales-insight).region} as Region
      - ${ref(sales-insight).revenue} as "Total Revenue"

Pivot Table

tables:
  - name: revenue-pivot
    columns:
      - ${ref(sales-insight).region}
    rows:
      - ${ref(sales-insight).product}
    values:
      - sum(${ref(sales-insight).revenue})
    format_cells:
      scope: columns
      min_color: "#ff0000"
      max_color: "#00ff00"

Attributes

Field Type Default Description
path string None A unique path to this object
name string None The unique name of the object across the entire project.
file_path string None The path to the file that contains the object definition.
selector Any of: Selector, string or string None The selector for the choosing which trace data is shown.
data Any of: CsvScriptModel, Insight, LocalMergeModel, SqlModel, string or string None A ${ ref() } to a model or insight. Shows all columns from the data source.
insights Any of: Insight, array None Deprecated. Use 'data' instead.
traces Array of Trace [] A ${ ref() } to a trace or trace defined in line. Data for the table will come from the trace.
column_defs Any of: TableColumnDefinition, array None A list of column definitions for trace-based tables.
rows_per_page 50 The number of rows to show per page. Default is 50 rows
columns array None Column fields using ${ref(name).field} syntax. Use alone for column selection/renaming, or with rows and values for pivot tables.
rows array None Pivot row fields using ${ref(name).field} syntax. Requires columns and values.
values array None Pivot value expressions with inline aggregation, e.g. [sum(${ref(insight).revenue})]. Requires columns and rows.
format_cells FormatCells None Gradient/heatmap cell formatting configuration.