Documentation

hourSelection() function

Flux 0.39.0+

The hourSelection() function retains all rows with time values in a specified hour range.

hourSelection(
  start: 9,
  stop: 17,
  timeColumn: "_time"
)

Parameters

start

(Required) The first hour of the hour range (inclusive). Hours range from [0-23].

stop

(Required) The last hour of the hour range (inclusive). Hours range from [0-23].

timeColumn

The column that contains the time value. Default is "_time".

tables

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

Examples

The following example uses generate.from() to generate sample data and show how covariance() transforms data.

Filter by business hours

import "generate"

data = generate.from(
  count: 8,
  fn: (n) => n * n,
  start: 2021-01-01T00:00:00Z,
  stop: 2021-01-02T00:00:00Z
)
  
data 
  |> hourSelection(start: 9, stop: 17)

View input and output


Upgrade to InfluxDB Cloud or InfluxDB 2.0!

InfluxDB Cloud and InfluxDB OSS 2.0 ready for production.