Documentation

sampledata.numericBool() function

Flux 0.128.0+

sampledata.numericBool returns a sample data set with numeric boolean values ([0,1]).

import "sampledata"

sampledata.numericBool(
  includeNull: false
)

Parameters

includeNull

Include null values in the returned dataset. Default is false.

Examples

Return sample data with numeric boolean values

Function
import "sampledata"

sampledata.numericBool()
Output tables
_time tag _value
2021-01-01T00:00:00Z t1 1
2021-01-01T00:00:10Z t1 1
2021-01-01T00:00:20Z t1 0
2021-01-01T00:00:30Z t1 1
2021-01-01T00:00:40Z t1 0
2021-01-01T00:00:50Z t1 0
_time tag _value
2021-01-01T00:00:00Z t2 0
2021-01-01T00:00:10Z t2 1
2021-01-01T00:00:20Z t2 0
2021-01-01T00:00:30Z t2 1
2021-01-01T00:00:40Z t2 1
2021-01-01T00:00:50Z t2 0

Return numeric boolean sample data with null values

Function
import "sampledata"

sampledata.numericBool(includeNull: true)
Output tables
_time tag _value
2021-01-01T00:00:00Z t1 1
2021-01-01T00:00:10Z t1
2021-01-01T00:00:20Z t1 0
2021-01-01T00:00:30Z t1
2021-01-01T00:00:40Z t1
2021-01-01T00:00:50Z t1 0
_time tag _value
2021-01-01T00:00:00Z t2
2021-01-01T00:00:10Z t2 1
2021-01-01T00:00:20Z t2 0
2021-01-01T00:00:30Z t2 1
2021-01-01T00:00:40Z t2
2021-01-01T00:00:50Z t2 0

Upgrade to InfluxDB Cloud or InfluxDB 2.0!

InfluxDB Cloud and InfluxDB OSS 2.0 ready for production.