hourSelection() function

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

*Function type: Transformation*

  1. hourSelection(
  2. start: 9,
  3. stop: 17,
  4. timeColumn: "_time"
  5. )

Parameters

start

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

*Data type: Integer*

stop

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

*Data type: Integer*

timeColumn

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

*Data type: String*

Examples

Use only data from 9am to 5pm
  1. from(bucket:"example-bucket")
  2. |> range(start:-90d)
  3. |> filter(fn: (r) => r._measurement == "foot-traffic" )
  4. |> hourSelection(start: 9, stop: 17)