Is there a way to get the Datetime corresponding to the latest value in a normalized timeSeries?
The simplest approach is to look at the latest field on the time series header. The latest field will provide the datetime of the latest normalized data point.
I am trying to write a metric that will return the dateTime of the latestValue, not the latestValue itself.
Is there a way to use the ExpressionEngineFunction to extract the dateTime from the LatestValue?
Use latest (e.g latest(normalized.data.quantity)) to get an identity timeseries of datetime values (corresponding to datetime of latest value).
Use latestValue (e.g. latestValue(normalized.data.quantity)) to get an identity timeseries of double values (corresponding to latest value).
Yes, that’s what
From the docs:
Returns Timeseries — the timeseries of the last available point (end) for which the TS has data (independent of query range).