month_normalize() divides a metric by the number of days in
the corresponding calendar month and multiplies it by 30.4375.
This enables you to compare metrics for different months and decide which one performed better, objectively. For
example, in the following table that summarizes the number of sales for three months, January has the highest number of
total sales:
| Month | Sales |
|---|---|
| Jan | 3000 |
| Feb | 2900 |
| Mar | 2900 |
| Month | Normalized sales |
|---|---|
| Jan | 2945.56 |
| Feb | 3152.46 |
| Mar | 2847.38 |
Samples
Get the normalized value for a metric of 1000, and a reference date of January 1, 2021:Arguments
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
metric | float8 | - | ✔ | The metric value to normalize |
reference_date | TIMESTAMPTZ | - | ✔ | Timestamp to normalize the metric with |
days | float8 | 365.25/12 | ❌ | Number of days to use for normalization |