sample() function selects a subset of the records from the input table.
sample() is a selector function.
sample(n:5, pos: -1)
sample() drops empty tables.
(Required) Sample every Nth element.
Position offset from the start of results where sampling begins.
pos must be less than
pos is less than 0, a random offset is used.
-1 (random offset).
Default is piped-forward data (
The following example uses data provided by the
to show how
sample() transforms data.
import "sampledata" sampledata.int() |> sample(n: 2, pos: 1)
View input and output
Support and feedback
Thank you for being part of our community! We welcome and encourage your feedback and bug reports for Flux and this documentation. To find support, the following resources are available:
InfluxDB Cloud customers can contact InfluxData Support.