Filter all metrics or KPIs in this Argument by date and time and return a new Argument that only includes the most recent data points. For example, if the KPI calculation can discard all but the latest value for each metric then the metrics variable can be filtered and re-assigned as follows:

metrics = metrics.latest();

var all = metrics.get('Unresolved Issues');    //latest unresolved

var critical = metrics.get('Critical Issues'); //latest critical

By default all metrics data collected for the day is provided to the KPI calculations and for KPI inputs the last 30 days of data is provided. For this reason the above reassignment is a very common pattern as many KPIs are built from the latest metrics. There are other ways of achieving the same date filtering without discarding all other data but this can be the cleanest and can reduce the apparent complexity of KPI formula.

Did this answer your question?