Documentation

fill() function

Flux 0.14.0+

The fill() function replaces all null values in an input stream with a non-null value. The output stream is the same as the input stream with all null values replaced in the specified column.

fill(column: "_value", value: 0.0)

// OR

fill(column: "_value", usePrevious: true)

Parameters

column

The column in which to replace null values. Defaults to "_value".

value

The constant value to use in place of nulls. The value type must match the value type of the column.

usePrevious

When true, assigns the value set in the previous non-null row.

Cannot be used with value.

tables

Input data. Default is piped-forward data (<-).

Examples

The following examples use data provided by the sampledata package to show how fill() transforms data.

Fill null values with a specified non-null value

import "sampledata"

sampledata.float(includeNull: true)
  |> fill(value: 0.0)

View input and output

Fill null values with the previous non-null value

import "sampledata"

sampledata.float(includeNull: true)
  |> fill(usePrevious: true)

View input and output


Upgrade to InfluxDB Cloud or InfluxDB 2.0!

InfluxDB Cloud and InfluxDB OSS 2.0 ready for production.