distinct() function
distinct()
returns all unique values in a specified column.
The _value
of each output record is set to a distinct value in the specified column.
null
is considered its own distinct value if present.
Function type signature
(<-tables: stream[A], ?column: string) => stream[B] where A: Record, B: Record
Parameters
column
Column to return unique values from. Default is _value
.
tables
Input data. Default is piped-forward data (<-
).
Examples
- Return distinct values from the _value column
- Return distinct values from a non-default column
- Return distinct values from data with null values
Return distinct values from the _value column
import "sampledata"
sampledata.int()
|> distinct()
Return distinct values from a non-default column
import "sampledata"
sampledata.int()
|> distinct(column: "tag")
Return distinct values from data with null values
import "sampledata"
sampledata.int(includeNull: true)
|> distinct()
Was this page helpful?
Thank you for your feedback!
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, use the following resources:
Customers with an annual or support contract can contact InfluxData Support.