PERIOD
Last updated
Was this helpful?
Last updated
Was this helpful?
The Period
syntax is useful for period-over-period comparisons such as year-over-year, i.e, comparing metrics from one period of one year to the same period of a previous year (e.g, Q2 2024 to Q2 2023).
Formulas can be defined at a period level to compute such time aggregations.
Syntax: Period
Example: Say you want to report the annual growth in ARR and summarize values correctly at quarterly and yearly levels without having to create multiple ARR metrics to compute and report these numbers:
For all quarterly aggregations, value = ARR of current quarter ÷ ARR of same quarter last year
For all yearly aggregations, value = ARR of current year ÷ ARR of last year
Let's create a metric called ARR Growth
to measure the growth of the metric ARR
. By default, the time summary for each quarter will be 'Sum' i.e. the value for Q1'23 for the metric ARR Growth = 108.33% + 107.69% + 107.14% = 323.17%
which doesn't correctly show the annual ARR growth.
Let's create a new metric called ARR Growth 2
and write the below formula to compute the time summaries for the quarterly and yearly periods accurately for our use case:
IF(PERIOD == 'q', ARR
<Current Quarter>
/ ARR
<q=q-4>
, IF (PERIOD == 'y', ARR
<current year>
/ ARR
<previous year>
, ARR))
Output:
The value for Q1 22 for the metric ARR Growth = $600
.
The value for Q1 23 for the metric ARR Growth = $4200/$600 = 700.00%
.
Use PERIOD
== 'h' for half-yearly aggregations.