Window measures on a numeric index column in metric views
Use unitless numeric offsets and ranges on integer order columns for non-calendar periods such as fiscal weeks.
O que mudou
Use cases
Imagine you need to calculate trends or comparisons across periods that do not follow traditional calendars—such as fiscal weeks, ISO weeks, or 4-4-5 accounting periods. With this update, window measures in metric views now support unitless numeric range and offset parameters on integer index columns.
This allows you to:
- Calculate moving averages or running totals using sequential integer positions.
- Perform period comparisons using numeric indices instead of calendar dates.
- Define flexible windows based on dense numeric sequences.
How to use
You configure the window measure by pointing to an integer index column and applying a numeric range or offset, ensuring dependency columns use the range: all specification.
version: 1.1
source: main.default.financial_data
fields:
- name: fiscal_year
expr: fiscal_year
- name: fiscal_period
expr: fiscal_period
- name: period_index
expr: fiscal_year * 12 + fiscal_period
window:
- order: period_index
range: all
measures:
- name: rolling_sales
expr: SUM(sales)
window:
- order: period_index
range: trailing 3
semiadditive: last
What happens in this code:
- The specified YAML version is 1.1.
- The data source points to a financial data table.
- The
period_indexfield is derived by combining fiscal year and period, withrange: allto prevent improper partitioning. - The
rolling_salesmeasure sums sales using a trailing window of 3 previous integer positions.
Limitations and requirements
- Requires Databricks Runtime 19 or above and YAML specification version 1.1 or above.
- The index column must be integral (
TINYINT,SMALLINT,INT, orBIGINT), monotonic, and consecutive (dense) without gaps or repeats.
- unity catalog
- metric views
- sql
- yaml
Window measures on a numeric index column in metric views
Resumo e explicação gerados por IA a partir da release note oficial. Em caso de dúvida, a documentação oficial da plataforma prevalece.
Relacionadas
- DatabricksGA
Repositórios de pacotes em nível de workspace para Databricks Apps
Administradores de workspace podem configurar repositórios padrão de pacotes Python e npm para Databricks Apps.
databricks apps · workspace settings - DatabricksGA
Redimensione partições de stateful streaming sem perder o checkpoint no Databricks
Agora é possível alterar o número de partições de shuffle em queries Structured Streaming e pipelines Lakeflow sem descartar o estado do checkpoint.
structured streaming · lakeflow - DatabricksAtualização
Google Gemini 4 Argon disponível no Unity Gateway do Databricks
O modelo multimodal Google Gemini 4 Argon já pode ser acessado via Foundation Model APIs e Unity Gateway.
unity catalog · foundation model apis