ACCUMULATION_AT_TIME
All functions > BUSINESS_HISTORICAL > ACCUMULATION_AT_TIME
Returns the state of an accumulation of events at the given point in time.
Syntax
ACCUMULATION_AT_TIME(accumulation: ARRAY<ROW(time_create: TIMESTAMP, time_delete: TIMESTAMP, ...)>, point_in_time: TIMESTAMP) → `ARRAY<ROW>`
sql
Arguments
Parameter | Type | Required | Description |
---|---|---|---|
accumulation | ARRAY<ROW(time_create: TIMESTAMP, time_delete: TIMESTAMP, ...)> | Yes | Array of temporal records with time_create and time_delete fields |
point_in_time | TIMESTAMP | Yes | Timestamp to query the accumulation state at |
Returns
ARRAY<ROW>
- Records that were active at the specified point in time
Notes
- Accumulation tracks records that exist during time ranges
- Each record has time_create (when created) and time_delete (when deleted, NULL if still active)
- Returns all records where point_in_time is between time_create and time_delete
- For records with SCD fields, resolves those fields to their values at point_in_time
- Useful for temporal tables, event logs, and tracking entity states over time
- Supports nested SCD values within accumulation records
- Returns empty array if no records were active at the specified time