Skip to content

Latest commit

 

History

History
44 lines (35 loc) · 965 Bytes

month_normalize.md

File metadata and controls

44 lines (35 loc) · 965 Bytes
api_name excerpt topics keywords api hyperfunction
month_normalize()
Normalize a monthly metric based on number of days in month
hyperfunctions
hyperfunctions
Toolkit
normalization
license type toolkit version
community
function
true
experimental stable
1.10.1
1.16.0
type
one-step operation

month_normalize()

Normalize the provided metric based on reference date and days.

Required arguments

Name Type Description
metric float8
reference_date TIMESTAMPTZ Timestamp to normalize the metric with
days float8 Optional, 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 month_normalize(1000,'2021-01-01 00:00:00+03'::timestamptz)

The output looks like this:

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