Skip to main content

Metric Tables

Overview​

Some numbers are not built from events. Revenue, MRR, active subscriptions or support ticket counts usually live in tables your data team already maintains in the warehouse. A metric table brings those numbers into Mitzu, next to your event-based insights.

A metric table is a table or view in your warehouse that your data team already maintains, for example a dbt model. Each row covers one period, for example one day. Mitzu turns every value column into a metric and applies date ranges, time grain, filters and break downs on top. Modelling stays in your warehouse, where it is versioned and reviewed with the rest of your data models. The one join Mitzu adds is to your dimension tables: when a column identifies an entity, such as a company, the metric can be broken down and filtered by that entity's properties.

Only workspace admins can add and configure metric tables.

Add a metric table​

Click Add metric table.

Source​

Choose the schema and the table or view, the same way as for event tables. The metric table is named after it, for example finance.daily_revenue, and each table can be added once.

Click Next: Columns. Mitzu reads the column list from the table's definition, without reading any rows, suggests a role for each column from its type and takes you to the Columns tab. While it reads, you see how long it has been waiting and can click Cancel to stop. A warehouse that was asleep can take a few minutes to start. If the read fails, you see the warehouse's error message on the Source tab.

Preview table is optional. It reads up to 1,000 rows, shows them on the Source tab with how many rows it fetched, fills in a sample value for each column and detects how much time one row covers from the spacing of the time values: hourly, daily, weekly, monthly, quarterly or yearly. Roles and names you already changed on Columns stay as they are. Picking another schema or table clears the preview.

info

On BigQuery, previewing a table reads its first rows without running a query, which BigQuery doesn't charge for. Views, materialized views and external tables can't be read that way, so Mitzu previews them with a query. BigQuery bills that query for a full scan of the tables behind the view, whatever the row limit, so prefer a table over a view on very large data.

Columns​

The Columns tab lists every column of the table in a paginated table, 10 per page, with a suggested role. Filter by column name or by role to find a column in a wide table. Sample values show once you preview the table, or, when you configure a saved table, for dimension columns Mitzu has already indexed. Without a preview, pick how much time one row covers yourself.

Mitzu suggests the role from the column's type: dates and timestamps become the time column, numbers become metric values unless the name looks like an identifier, and other columns become dimensions. Only date or timestamp columns can be the time column for now. A number or text column that stores dates, such as a Unix timestamp, can't be picked as Time. Convert it to a date or timestamp in the table or view first.

Mitzu keeps the column list of a table for up to 24 hours. If you just added a column in the warehouse, click the refresh icon next to Table or view, then Next: Columns, and the new column shows up.

RoleUse it for
TimeThe date or timestamp of the row. At most one column, and it must be a date or timestamp column. Without a time column each metric is a single number, for example current ARR.
Metric valueA number you want to chart. Give it a metric name and a roll-up rule.
DimensionA column to break down and filter by, such as plan_type.
Identifier · EntityA column that holds an entity's ID, such as company_id for companies. The entity's dimension tables are joined on it.
IgnoreColumns Mitzu doesn't use.

For a dimension column you can pick the matching property: an event property, or a property of an entity such as a user or a company, grouped by entity with its icon. Mitzu suggests one when the names match. With the link in place, an insight filter on that property applies to the metric too. If the linked property no longer exists, the modal warns you but still saves.

Metric names may repeat across metric tables. Mitzu warns about a repeated name but doesn't block saving.

Identifiers​

Pick Identifier · Company (or any other entity from the Entities page) for a column that holds that entity's ID, for example a table with one row per company per day. Mitzu suggests the role when a column has the same name as an event table's key for the entity. The entity's dimension tables are then joined to the metric table on that column, and their properties become break downs and filters of every metric in the table, the same way they work for events.

A line under the columns says what joins, for example company_id joins 1 Company dimension table, adding Industry, Plan, Region +4. A dimension table with a custom join condition is joined on the metric table's columns its condition names. When the metric table lacks one of them, that dimension table isn't joined, and the line names the missing column.

Mark an identifier only for a column that holds an entity's ID. A column that only describes the row, such as plan_type, is a Dimension.

caution

Each ID must appear once in the dimension table. Mitzu doesn't check this: when a company has two rows in a dimension table, each of its metric rows is counted twice. The same holds for events joined to that table.

Rolling up to longer periods​

The roll-up rule decides what Mitzu shows when you look at a longer period than one row, or at a single big number. Summing daily MRR, for example, gives a meaningless total.

RuleUse it forA week of daily rows shows
Add upRevenue, signups, ordersthe sum of its days
Use the latest valueMRR, active subscriptions, balancesits last day
Use the earliest valueOpening balances, MRR at the start of a monthits first day
AverageAverage daily MRR over a month, average queue lengththe average of its days
MedianA typical day's order size or support backlog, without outliers pulling it aroundthe median of its days
75th percentileA busy day's queue lengththe 75th percentile of its days
90th percentileHow slow the worst days' response times getthe 90th percentile of its days
Lowest valueLowest daily balanceits lowest day
Highest valuePeak concurrent usersits highest day
Don't roll upUnique counts, ratesnothing: the metric is shown only at the grain one row has, because summing daily unique users counts returning users twice
info

For rates such as conversion rate or average order value, pick Don't roll up, or add the two parts (for example orders and visitors) as separate metrics and divide them with a formula. Averaging daily rates ignores how many orders or users each day had.

Median and the percentiles are worked out the same way on every warehouse: the rows of a period are sorted by value, and when the percentile falls between two rows Mitzu interpolates between them, like PERCENTILE_CONT in SQL. A week of seven daily rows has a median of its fourth day; its 90th percentile sits 40% of the way from its sixth day to its seventh. Like Average, every row counts the same, however many orders or users it covers.

Check the roles and roll-up rules, then click Save on the Columns tab (Back returns to the source). Mitzu blocks saving and says why when there is no metric value column or when more than one column is marked as the time column.

Charting and documenting the metrics​

Once a metric table is indexed, its metrics can be charted in segmentation insights, on dashboards and by the analytics agent; see Warehouse metrics. Their names, descriptions and visibility are kept in the warehouse metric catalog. For how metric tables fit next to event and dimension tables, see Metric tables in the data model.

Configure a metric table​

Select a metric table and click Configure. The same modal opens on the Columns tab with the saved settings, and you can switch between Source and Columns freely and save from either tab. A saved metric table keeps its schema and table, the same as event and dimension tables. To use another table, remove the metric table and add the new one. Opening the modal and switching tabs don't read the warehouse. Preview table reads rows only when you click it, and adds any columns that are new in the table. Metric names show their current names from the catalog, so saving the definition never undoes a rename made in the catalog.

Saving indexes the table again when you changed its grain, or a column's name or role.

Indexing​

Indexing checks that every configured column still exists with a compatible type, collects the values of each dimension for the filter value pickers, and checks the time grain. Charts always query the warehouse live, so new rows never need indexing. A table is indexed when you save it; to index it again, select it and click Index tables. The Status column shows Indexed, Indexing, Queued, Re-index, Not indexed, Error, Cancelled or Disabled. Grain changed means the rows now cover a different period than the one set in Configure, so roll-ups into longer periods may be wrong until you fix it.

Enable / Disable turns a metric table off without removing it. Its metrics leave the event picker, and charts that use them show a message saying the table is turned off.