Cumulative Metrics

circle-exclamation

Cumulative metrics are created from a Simple metric that is then accumulated over time. They typically answer questions like "How much so far?" or "How much over the last N days?"

For example, common cumulative metrics include:

  • Rolling 7/28/90 day totals

  • Month-to-date (MTD), quarter-to-date (QTD), or year-to-date (YTD)

Type Params

Simple Metric (required)

The Simple metric that you want to accumulate over time (e.g. total revenue, total orders, etc)

Filters (optional)

circle-exclamation

Filters can reference any dimension that is reachable via Athenic’s safe join paths. Use filters to define scoped cumulative metrics like:

  • Month-to-date sales for active customers

Filter Example: customers.status = 'Active'

Cumulative Type Params

Period Aggregation (optional)

The period aggregation controls how multiple cumulative values within a reporting period (e.g. week, month) should be reduced into a single value.

Possible Values:

  • Last - Use the cumulative value from the end of the reporting period (the latest date in the period). This is the most common choice for MTD/QTD/YTD style metrics.

  • First - Use the cumulative value from the start of the reporting period (the earliest date in the period).

  • Average - Use the average of all cumulative values observed within the reporting period.

Window (optional)

The window controls the size of a rolling (trailing) time range used to compute the cumulative value at each point in time. For each date/time in the result, the metric is accumulated over the previous N units of time (including the current point), where N and the unit are defined by the window settings.

If no window is specified, the period is considered infinite and the values are accumulated over all time.

Inputs:

  • Value (numeric) - the window length (e.g. 20)

  • Time granularity - one of seconds, minutes, hours, days, weeks, months, quarters, or years

Grain to Date (optional)

Grain to date controls a “to-date” cumulative calculation that resets at the start of each specified period. For each date/time in the result, the metric is accumulated from the beginning of the current week/month/quarter/year up to that point.

Possible Values:

  • Week

  • Month

  • Quarter

  • Year

Fill Missing Dates and Nulls (optional)

For advanced time-series modeling, you can use these fields to ensure consistent numeric outputs across time:

  • Fill Nulls: sets null metric values to a chosen value (commonly 0) so the ratio can be computed more consistently in sparse datasets.

  • Fill Missing Dates: joins the metric to a time spine so you get a value for every date in the requested range (even when no source rows exist for some dates).

These options are most helpful when charting cumulative metrics over time and you want uninterrupted series.

Last updated