Fills in gaps in the expression with the last known value of the expression. If you specify `a time window, fills in a specified time period after each existing point.
|timeWindow||By default, the |
|expression||Expression in which you want to replace gaps in data with the last value.|
last() function allows you to assign the last known reported data point value to a gap of missing data. When you add
last() to a
ts() expression, a solid straight line with the value of the last reported data point will be drawn in place of gaps of missing data.
last() applies the last reported data value to gaps of missing data for up to 4 weeks. If you’d like this window to be smaller, you can use the
timeWindow parameter. If you use
last() with a function that uses interpolation, we apply
last() to the last 15% of a chart window.
In the following example, we’ve zoomed in on ~sample.request.failures.num and see missing data.
We decide to replace the missing data with the last value before the gap, in this case 0.
Then we replace the missing data with the first good value after the gap using