metrics - an Argument object that can contain zero, one or more lists of metric data
kpis - an Argument object that can contain zero, one or more lists of KPI data
now - a Calculation Date object that represents the date and time when the KPI is calculated for, nominally this is 'now' but is could be date in the past.
Which metrics and KPIs are available to the calculation depends on how the KPI parameters are configured. It is common to have no KPIs or no metrics, a single metric or KPI or a collection of both. For this reason the Arguments object provides functions to pick out individual metrics/KPIs or filter sets of them. It also provides functions for finding the latest or first time values and additional checks for missing values. A detailed description of the functionality provided by the Arguments object can be found in the Reference section of this document.
KPI calculations are made for a specific date and time. Normally this date and time will be time at which the calculation is run but if a KPI is (re)calculated for past dates the date value of the now variable will reflect the historic date of the calculation and the time will always be set to 23:59:59 - the last moment of the day. This is because only one value can be stored for a KPI for a given date and the last time stamp always overrides a previous one.
As illustrated in the examples from the previous section the now variable has a number of useful functions for defining date ranges that can be used in filters and prediction calculations. A detailed description of the functionality provided by the Calculation Date object can be found in the Reference section of this document.
undefined - There is no requirement to return anything as not all KPIs have a value for all dates.
numeric value - the value for the KPI on the date defined by now
value for the KPI on the date, the
breakdown for the KPI and optionally a numeric
sample size for cases where aggregations can be affected by the significance of the input data.