Skip to content
TimescaleDB - Timeseries database for PostgreSQL
  • Timescale.com
  • Try for free
Getting started
Use Timescale
Tutorials
Code quick starts
API Reference
Hypertables & chunks
Distributed hypertables
Compression
Continuous aggregates
Data retention
Actions and automation
Hyperfunctions
approximate_row_count
first
last
histogram
time_bucket
time_bucket_ng
days_in_month
month_normalize
Approximate count distinct
Saturating math
Statistical and regression analysis
Minimum and maximum
Financial analysis
Gapfilling
Percentile approximation
Counters and gauges
Time-weighted calculations
Downsampling
Frequency analysis
State tracking
Informational views
Configuration
Administration Functions
API Reference Tag Overview
Other deployment options
About Timescale
Find a docs page
Try for free
TimescaleDB API referenceHyperfunctions

month_normalize() ToolkitTimescaleDB Toolkit functions are available under Timescale Community Edition. They are automatically included with Timescale Cloud. Click to learn more.ExperimentalExperimental TimescaleDB Toolkit functions are not suitable for production environments. They may have bugs and may cause data loss. Click to learn more.

Normalize the provided metric based on reference date and days.

Required arguments

NameTypeDescription
metricfloat8
reference_dateTIMESTAMPTZTimestamp to normalize the metric with
daysfloat8Optional, defaults to 365.25/12 if none provided

Sample usage

Get the normalized value for a metric of 1000, and a reference date of January 1, 2021:

SELECT toolkit_experimental.month_normalize(1000,'2021-01-01 00:00:00+03'::timestamptz)

The output looks like this:

month_normalize
----------------------
981.8548387096774

Found an issue on this page?

Report an issue!

Keywords

hyperfunctionsToolkitnormalization
Previousdays_in_monthNextApproximate count distinct

Related Content

days_in_month()
Calculates days in month given a timestamptz
Hyperfunctions
Use hyperfunctions to simplify data analysis
Downsampling functions
API reference for the downsampling functions
Saturating math functions
API reference for the saturating math functions
state_agg()
API reference for the state_agg() functions
max_n()
API reference for the max_n() functions