series_fill_backward()
Learn how to use the series_fill_backward() function to perform a backward fill interpolation of missing values in a series.
Performs a backward fill interpolation of missing values in a series.
An expression containing dynamic numerical array is the input. The function replaces all instances of missing_value_placeholder with the nearest value from its right side (other than missing_value_placeholder), and returns the resulting array. The rightmost instances of missing_value_placeholder are preserved.
Syntax
series_fill_backward(series[,missing_value_placeholder])
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| series | dynamic | ✔️ | An array of numeric values. |
| missing_value_placeholder | scalar | Specifies a placeholder for missing values. The default value is double(null). The value can be of any type that converts to actual element types. double(null), long(null), and int(null) have the same meaning. |
Returns
series with all instances of missing_value_placeholder filled backwards.
Example
The following example performs a backwards fill on missing data in the datatable, data.
let data = datatable(arr: dynamic)
[
dynamic([111, null, 36, 41, null, null, 16, 61, 33, null, null])
];
data
| project
arr,
fill_backward = series_fill_backward(arr)
Output
arr | fill_backward |
|---|---|
| [111,null,36,41,null,null,16,61,33,null,null] | [111,36,36,41,16,16,16,61,33,null,null] |
Related content
- Time series analysis
- make-series operator
- series_fill_const()
- series_fill_forward()
- series_fill_linear()
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.