Skip to main content

Create metric table request

A new metric table.

table_schemastringrequired

Schema.

Example: analytics
table_namestringrequired

Table name.

Example: daily_revenue
grainstringrequired

How much time one row covers.

Possible values: [hour, day, week, month, quarter, year, single_number]

columns object[]required

Columns and their roles.

  • Array [
  • column_namestringrequired

    Warehouse column name.

    Example: revenue
    rolestringrequired

    What the column holds.

    Possible values: [time, metric_value, dimension, identifier, ignored]

    metric_namestringnullable

    Name of the metric, required for metric_value columns.

    Example: Revenue
    roll_upstringnullable

    How a metric_value column adds up into longer periods.

    Possible values: [add_up, latest_value, earliest_value, average, median, p75, p90, min, max, no_roll_up]

    entitystringnullable

    Entity an identifier column identifies.

    Example: user
    linked_event_propertystringnullable

    Event property a dimension column matches, so filters can apply to both.

  • ]
  • Create metric table request
    {
    "table_schema": "analytics",
    "table_name": "daily_revenue",
    "grain": "hour",
    "columns": [
    {
    "column_name": "revenue",
    "role": "time",
    "metric_name": "Revenue",
    "roll_up": "add_up",
    "entity": "user",
    "linked_event_property": "string"
    }
    ]
    }