merged master into tags branch
commit
eadde36c29
|
@ -50,6 +50,11 @@ jobs:
|
|||
- run:
|
||||
name: Deploy to S3
|
||||
command: $HOME/bin/s3deploy -source=workspace/public/ -bucket=$BUCKET -region=$REGION -distribution-id=$CF_DISTRIBUTION_ID
|
||||
- run:
|
||||
name: Post in Slack
|
||||
command: >
|
||||
export COMMIT_INFO="$(git log -1 --format='%n>>>%s%n%b%n_<https://github.com/influxdata/docs-v2/commit/%H|Commit %h> - by %an_')"; curl -X POST --data-urlencode "payload={\"username\": \"Doc the Docs Bot\", \"text\": \"The InfluxDB v2 docs successfully deployed! :greeny_peeny:\n\n $COMMIT_INFO\", \"icon_emoji\": \":doc_green:\"}" $SLACK_DOCS_WEBHOOK_URL
|
||||
when: on_success
|
||||
|
||||
workflows:
|
||||
version: 2
|
||||
|
|
|
@ -188,7 +188,10 @@
|
|||
border-radius: $border-radius;
|
||||
overflow-x: scroll;
|
||||
overflow-y: hidden;
|
||||
code { padding: 0; }
|
||||
code {
|
||||
padding: 0;
|
||||
line-height: 1.4rem;
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////// Tables ////////////////////////////////////
|
||||
|
|
|
@ -134,6 +134,30 @@
|
|||
}
|
||||
ul {
|
||||
margin-left: -.95em;
|
||||
li:before {
|
||||
top: .4em;
|
||||
}
|
||||
&.open {
|
||||
margin-top: -.25em;
|
||||
padding-top: .25em;
|
||||
}
|
||||
}
|
||||
|
||||
&.active {
|
||||
&:before {
|
||||
background: $nav-active;
|
||||
}
|
||||
& > a {
|
||||
color: $nav-active;
|
||||
&:hover { color: $nav-active; }
|
||||
}
|
||||
& > .children-toggle {
|
||||
background: $nav-active;
|
||||
&:before, &:after { background: $body-bg; }
|
||||
}
|
||||
& > ul {
|
||||
border-left: 2px solid $nav-active;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -132,6 +132,7 @@ $nav-border: $g5-pepper !default;
|
|||
$nav-toggle: $g16-pearl !default;
|
||||
$nav-toggle-hover: $g16-pearl !default;
|
||||
$nav-toggle-bg-hover: $b-ocean !default;
|
||||
$nav-active: $gr-rainforest !default;
|
||||
|
||||
// Error Page Colors
|
||||
$error-page-btn: $b-ocean !default;
|
||||
|
|
|
@ -131,6 +131,7 @@ $nav-border: $g14-chromium;
|
|||
$nav-toggle: $g20-white;
|
||||
$nav-toggle-hover: $g20-white;
|
||||
$nav-toggle-bg-hover: $b-ocean;
|
||||
$nav-active: $gr-canopy;
|
||||
|
||||
// Error Page Colors
|
||||
$error-page-btn: $b-ocean;
|
||||
|
|
|
@ -13,7 +13,7 @@ menu:
|
|||
{{% note %}}
|
||||
The steps below are available on a page that appears after you complete the initial configuration described in [Set up InfluxDB](/v2.0/get-started/#setup-influxdb). After clicking one of the three options, the page is no longer available.
|
||||
|
||||
If you missed the change to select Quick Start or you want to learn how to configure a scraper yourself, see [Scrape data using the /metrics endpoint](influxdb/v2.0/collect-data/scraper-endpoint/).
|
||||
If you missed the change to select Quick Start or you want to learn how to configure a scraper yourself, see [Scrape data using the /metrics endpoint](/v2.0/collect-data/scraper-metrics-endpoint/).
|
||||
{{% /note %}}
|
||||
|
||||
## Use Quick Start to collect InfluxDB metrics
|
||||
|
|
|
@ -22,7 +22,7 @@ executables, and running the the initial setup process.
|
|||
### Download and install InfluxDB v2.0 alpha
|
||||
Download InfluxDB v2.0 alpha for macOS.
|
||||
|
||||
<a class="btn download" href="https://dl.influxdata.com/influxdb/releases/influxdb_2.0.0-alpha.1_darwin_amd64.tar.gz" download>InfluxDB v2.0 alpha (macOS)</a>
|
||||
<a class="btn download" href="https://dl.influxdata.com/influxdb/releases/influxdb_2.0.0-alpha.3_darwin_amd64.tar.gz" download>InfluxDB v2.0 alpha (macOS)</a>
|
||||
|
||||
### Place the executables in your $PATH
|
||||
Unpackage the downloaded archive and place the `influx` and `influxd` executables in your system `$PATH`.
|
||||
|
@ -31,10 +31,10 @@ _**Note:** The following commands are examples. Adjust the file paths to your ow
|
|||
|
||||
```sh
|
||||
# Unpackage contents to the current working directory
|
||||
gunzip -c ~/Downloads/influxdb_2.0.0-alpha.1_darwin_amd64.tar.gz | tar xopf -
|
||||
gunzip -c ~/Downloads/influxdb_2.0.0-alpha.3_darwin_amd64.tar.gz | tar xopf -
|
||||
|
||||
# Copy the influx and influxd binary to your $PATH
|
||||
sudo cp influxdb_2.0.0-alpha.1_darwin_amd64/{influx,influxd} /usr/local/bin/
|
||||
sudo cp influxdb_2.0.0-alpha.3_darwin_amd64/{influx,influxd} /usr/local/bin/
|
||||
```
|
||||
|
||||
{{% note %}}
|
||||
|
@ -63,7 +63,7 @@ By default, InfluxDB sends telemetry data back to InfluxData.
|
|||
The [InfluxData telemetry](https://www.influxdata.com/telemetry) page provides
|
||||
information about what data is collected and how it is used.
|
||||
|
||||
Top opt-out of sending telemetry data back to InfluxData, include the
|
||||
To opt-out of sending telemetry data back to InfluxData, include the
|
||||
`--reporting-disabled` flag when starting `influxd`.
|
||||
|
||||
```bash
|
||||
|
@ -77,10 +77,10 @@ influxd --reporting-disabled
|
|||
<!-------------------------------- BEGIN Linux -------------------------------->
|
||||
{{% tab-content %}}
|
||||
### Download and install InfluxDB v2.0 alpha
|
||||
Download InfluxDB v2.0 alpha package appropriate for your chipset.
|
||||
Download the InfluxDB v2.0 alpha package appropriate for your chipset.
|
||||
|
||||
<a class="btn download" href="https://dl.influxdata.com/influxdb/releases/influxdb_2.0.0-alpha.1_linux_amd64.tar.gz" download >InfluxDB v2.0 alpha (amd64)</a>
|
||||
<a class="btn download" href="https://dl.influxdata.com/influxdb/releases/influxdb_2.0.0-alpha.1_linux_arm64.tar.gz" download >InfluxDB v2.0 alpha (arm)</a>
|
||||
<a class="btn download" href="https://dl.influxdata.com/influxdb/releases/influxdb_2.0.0-alpha.3_linux_amd64.tar.gz" download >InfluxDB v2.0 alpha (amd64)</a>
|
||||
<a class="btn download" href="https://dl.influxdata.com/influxdb/releases/influxdb_2.0.0-alpha.3_linux_arm64.tar.gz" download >InfluxDB v2.0 alpha (arm)</a>
|
||||
|
||||
### Place the executables in your $PATH
|
||||
Unpackage the downloaded archive and place the `influx` and `influxd` executables in your system `$PATH`.
|
||||
|
@ -89,10 +89,10 @@ _**Note:** The following commands are examples. Adjust the file names, paths, an
|
|||
|
||||
```sh
|
||||
# Unpackage contents to the current working directory
|
||||
tar xvzf path/to/influxdb_2.0.0-alpha.1_linux_amd64.tar.gz
|
||||
tar xvzf path/to/influxdb_2.0.0-alpha.3_linux_amd64.tar.gz
|
||||
|
||||
# Copy the influx and influxd binary to your $PATH
|
||||
sudo cp influxdb_2.0.0-alpha.1_linux_amd64/{influx,influxd} /usr/local/bin/
|
||||
sudo cp influxdb_2.0.0-alpha.3_linux_amd64/{influx,influxd} /usr/local/bin/
|
||||
```
|
||||
|
||||
{{% note %}}
|
||||
|
@ -121,7 +121,7 @@ By default, InfluxDB sends telemetry data back to InfluxData.
|
|||
The [InfluxData telemetry](https://www.influxdata.com/telemetry) page provides
|
||||
information about what data is collected and how it is used.
|
||||
|
||||
Top opt-out of sending telemetry data back to InfluxData, include the
|
||||
To opt-out of sending telemetry data back to InfluxData, include the
|
||||
`--reporting-disabled` flag when starting `influxd`.
|
||||
|
||||
```bash
|
||||
|
@ -148,7 +148,7 @@ By default, InfluxDB sends telemetry data back to InfluxData.
|
|||
The [InfluxData telemetry](https://www.influxdata.com/telemetry) page provides
|
||||
information about what data is collected and how it is used.
|
||||
|
||||
Top opt-out of sending telemetry data back to InfluxData, include the
|
||||
To opt-out of sending telemetry data back to InfluxData, include the
|
||||
`--reporting-disabled` flag when starting the InfluxDB container.
|
||||
|
||||
```bash
|
||||
|
|
|
@ -32,7 +32,7 @@ A separate bucket where aggregated, downsampled data is stored.
|
|||
To downsample data, it must be aggregated in some way.
|
||||
What specific method of aggregation you use depends on your specific use case,
|
||||
but examples include mean, median, top, bottom, etc.
|
||||
View [Flux's aggregate functions](/v2.0/reference/flux/functions/transformations/aggregates/)
|
||||
View [Flux's aggregate functions](/v2.0/reference/flux/functions/built-in/transformations/aggregates/)
|
||||
for more information and ideas.
|
||||
|
||||
## Create a destination bucket
|
||||
|
@ -47,7 +47,7 @@ The example task script below is a very basic form of data downsampling that doe
|
|||
1. Defines a task named "cq-mem-data-1w" that runs once a week.
|
||||
2. Defines a `data` variable that represents all data from the last 2 weeks in the
|
||||
`mem` measurement of the `system-data` bucket.
|
||||
3. Uses the [`aggregateWindow()` function](/v2.0/reference/flux/functions/transformations/aggregates/aggregatewindow/)
|
||||
3. Uses the [`aggregateWindow()` function](/v2.0/reference/flux/functions/built-in/transformations/aggregates/aggregatewindow/)
|
||||
to window the data into 1 hour intervals and calculate the average of each interval.
|
||||
4. Stores the aggregated data in the `system-data-downsampled` bucket under the
|
||||
`my-org` organization.
|
||||
|
|
|
@ -52,8 +52,8 @@ in form fields when creating the task.
|
|||
{{% /note %}}
|
||||
|
||||
## Define a data source
|
||||
Define a data source using Flux's [`from()` function](/v2.0/reference/flux/functions/inputs/from/)
|
||||
or any other [Flux input functions](/v2.0/reference/flux/functions/inputs/).
|
||||
Define a data source using Flux's [`from()` function](/v2.0/reference/flux/functions/built-in/inputs/from/)
|
||||
or any other [Flux input functions](/v2.0/reference/flux/functions/built-in/inputs/).
|
||||
|
||||
For convenience, consider creating a variable that includes the sourced data with
|
||||
the required time range and any relevant filters.
|
||||
|
@ -86,7 +86,7 @@ specific use case.
|
|||
The example below illustrates a task that downsamples data by calculating the average of set intervals.
|
||||
It uses the `data` variable defined [above](#define-a-data-source) as the data source.
|
||||
It then windows the data into 5 minute intervals and calculates the average of each
|
||||
window using the [`aggregateWindow()` function](/v2.0/reference/flux/functions/transformations/aggregates/aggregatewindow/).
|
||||
window using the [`aggregateWindow()` function](/v2.0/reference/flux/functions/built-in/transformations/aggregates/aggregatewindow/).
|
||||
|
||||
```js
|
||||
data
|
||||
|
@ -102,7 +102,7 @@ _See [Common tasks](/v2.0/process-data/common-tasks) for examples of tasks commo
|
|||
In the vast majority of task use cases, once data is transformed, it needs to sent and stored somewhere.
|
||||
This could be a separate bucket with a different retention policy, another measurement, or even an alert endpoint _(Coming)_.
|
||||
|
||||
The example below uses Flux's [`to()` function](/v2.0/reference/flux/functions/outputs/to)
|
||||
The example below uses Flux's [`to()` function](/v2.0/reference/flux/functions/built-in/outputs/to)
|
||||
to send the transformed data to another bucket:
|
||||
|
||||
```js
|
||||
|
|
|
@ -18,8 +18,8 @@ Every Flux query needs the following:
|
|||
|
||||
|
||||
## 1. Define your data source
|
||||
Flux's [`from()`](/v2.0/reference/flux/functions/inputs/from) function defines an InfluxDB data source.
|
||||
It requires a [`bucket`](/v2.0/reference/flux/functions/inputs/from#bucket) parameter.
|
||||
Flux's [`from()`](/v2.0/reference/flux/functions/built-in/inputs/from) function defines an InfluxDB data source.
|
||||
It requires a [`bucket`](/v2.0/reference/flux/functions/built-in/inputs/from#bucket) parameter.
|
||||
The following examples use `example-bucket` as the bucket name.
|
||||
|
||||
```js
|
||||
|
@ -31,7 +31,7 @@ Flux requires a time range when querying time series data.
|
|||
"Unbounded" queries are very resource-intensive and as a protective measure,
|
||||
Flux will not query the database without a specified range.
|
||||
|
||||
Use the pipe-forward operator (`|>`) to pipe data from your data source into the [`range()`](/v2.0/reference/flux/functions/transformations/range)
|
||||
Use the pipe-forward operator (`|>`) to pipe data from your data source into the [`range()`](/v2.0/reference/flux/functions/built-in/transformations/range)
|
||||
function, which specifies a time range for your query.
|
||||
It accepts two properties: `start` and `stop`.
|
||||
Ranges can be **relative** using negative [durations](/v2.0/reference/flux/language/lexical-elements#duration-literals)
|
||||
|
|
|
@ -42,7 +42,7 @@ A common type of function used when transforming data queried from InfluxDB is a
|
|||
Aggregate functions take a set of `_value`s in a table, aggregate them, and transform
|
||||
them into a new value.
|
||||
|
||||
This example uses the [`mean()` function](/v2.0/reference/flux/functions/transformations/aggregates/mean)
|
||||
This example uses the [`mean()` function](/v2.0/reference/flux/functions/built-in/transformations/aggregates/mean)
|
||||
to average values within each time window.
|
||||
|
||||
{{% note %}}
|
||||
|
@ -52,7 +52,7 @@ It's just good to understand the steps in the process.
|
|||
{{% /note %}}
|
||||
|
||||
## Window your data
|
||||
Flux's [`window()` function](/v2.0/reference/flux/functions/transformations/window) partitions records based on a time value.
|
||||
Flux's [`window()` function](/v2.0/reference/flux/functions/built-in/transformations/window) partitions records based on a time value.
|
||||
Use the `every` parameter to define a duration of each window.
|
||||
|
||||
For this example, window data in five minute intervals (`5m`).
|
||||
|
@ -75,7 +75,7 @@ When visualized, each table is assigned a unique color.
|
|||
|
||||
## Aggregate windowed data
|
||||
Flux aggregate functions take the `_value`s in each table and aggregate them in some way.
|
||||
Use the [`mean()` function](/v2.0/reference/flux/functions/transformations/aggregates/mean) to average the `_value`s of each table.
|
||||
Use the [`mean()` function](/v2.0/reference/flux/functions/built-in/transformations/aggregates/mean) to average the `_value`s of each table.
|
||||
|
||||
```js
|
||||
from(bucket:"example-bucket")
|
||||
|
@ -101,7 +101,7 @@ Aggregate functions don't infer what time should be used for the aggregate value
|
|||
Therefore the `_time` column is dropped.
|
||||
|
||||
A `_time` column is required in the [next operation](#unwindow-aggregate-tables).
|
||||
To add one, use the [`duplicate()` function](/v2.0/reference/flux/functions/transformations/duplicate)
|
||||
To add one, use the [`duplicate()` function](/v2.0/reference/flux/functions/built-in/transformations/duplicate)
|
||||
to duplicate the `_stop` column as the `_time` column for each windowed table.
|
||||
|
||||
```js
|
||||
|
@ -146,7 +146,7 @@ process helps to understand how data changes "shape" as it is passed through eac
|
|||
|
||||
Flux provides (and allows you to create) "helper" functions that abstract many of these steps.
|
||||
The same operation performed in this guide can be accomplished using the
|
||||
[`aggregateWindow()` function](/v2.0/reference/flux/functions/transformations/aggregates/aggregatewindow).
|
||||
[`aggregateWindow()` function](/v2.0/reference/flux/functions/built-in/transformations/aggregates/aggregatewindow).
|
||||
|
||||
```js
|
||||
from(bucket:"example-bucket")
|
||||
|
|
|
@ -71,7 +71,7 @@ functionName = (tables=<-) => tables |> functionOperations
|
|||
###### Multiply row values by x
|
||||
The example below defines a `multByX` function that multiplies the `_value` column
|
||||
of each row in the input table by the `x` parameter.
|
||||
It uses the [`map()` function](/v2.0/reference/flux/functions/transformations/map)
|
||||
It uses the [`map()` function](/v2.0/reference/flux/functions/built-in/transformations/map)
|
||||
to modify each `_value`.
|
||||
|
||||
```js
|
||||
|
@ -105,9 +105,9 @@ Defaults are overridden by explicitly defining the parameter in the function cal
|
|||
###### Get the winner or the "winner"
|
||||
The example below defines a `getWinner` function that returns the record with the highest
|
||||
or lowest `_value` (winner versus "winner") depending on the `noSarcasm` parameter which defaults to `true`.
|
||||
It uses the [`sort()` function](/v2.0/reference/flux/functions/transformations/sort)
|
||||
It uses the [`sort()` function](/v2.0/reference/flux/functions/built-in/transformations/sort)
|
||||
to sort records in either descending or ascending order.
|
||||
It then uses the [`limit()` function](/v2.0/reference/flux/functions/transformations/limit)
|
||||
It then uses the [`limit()` function](/v2.0/reference/flux/functions/built-in/transformations/limit)
|
||||
to return the first record from the sorted table.
|
||||
|
||||
```js
|
||||
|
|
|
@ -29,7 +29,7 @@ Understanding how modifying group keys shapes output data is key to successfully
|
|||
grouping and transforming data into your desired output.
|
||||
|
||||
## group() Function
|
||||
Flux's [`group()` function](/v2.0/reference/flux/functions/transformations/group) defines the
|
||||
Flux's [`group()` function](/v2.0/reference/flux/functions/built-in/transformations/group) defines the
|
||||
group key for output tables, i.e. grouping records based on values for specific columns.
|
||||
|
||||
###### group() example
|
||||
|
|
|
@ -14,8 +14,8 @@ weight: 207
|
|||
Histograms provide valuable insight into the distribution of your data.
|
||||
This guide walks through using Flux's `histogram()` function to transform your data into a **cumulative histogram**.
|
||||
|
||||
## histgram() function
|
||||
The [`histogram()` function](/v2.0/reference/flux/functions/transformations/histogram) approximates the
|
||||
## histogram() function
|
||||
The [`histogram()` function](/v2.0/reference/flux/functions/built-in/transformations/histogram) approximates the
|
||||
cumulative distribution of a dataset by counting data frequencies for a list of "bins."
|
||||
A **bin** is simply a range in which a data point falls.
|
||||
All data points that are less than or equal to the bound are counted in the bin.
|
||||
|
@ -42,7 +42,7 @@ Flux provides two helper functions for generating histogram bins.
|
|||
Each generates an array of floats designed to be used in the `histogram()` function's `bins` parameter.
|
||||
|
||||
### linearBins()
|
||||
The [`linearBins()` function](/v2.0/reference/flux/functions/misc/linearbins) generates a list of linearly separated floats.
|
||||
The [`linearBins()` function](/v2.0/reference/flux/functions/built-in/misc/linearbins) generates a list of linearly separated floats.
|
||||
|
||||
```js
|
||||
linearBins(start: 0.0, width: 10.0, count: 10)
|
||||
|
@ -51,7 +51,7 @@ linearBins(start: 0.0, width: 10.0, count: 10)
|
|||
```
|
||||
|
||||
### logarithmicBins()
|
||||
The [`logarithmicBins()` function](/v2.0/reference/flux/functions/misc/logarithmicbins) generates a list of exponentially separated floats.
|
||||
The [`logarithmicBins()` function](/v2.0/reference/flux/functions/built-in/misc/logarithmicbins) generates a list of exponentially separated floats.
|
||||
|
||||
```js
|
||||
logarithmicBins(start: 1.0, factor: 2.0, count: 10, infinty: true)
|
||||
|
|
|
@ -10,7 +10,7 @@ menu:
|
|||
weight: 205
|
||||
---
|
||||
|
||||
The [`join()` function](/v2.0/reference/flux/functions/transformations/join) merges two or more
|
||||
The [`join()` function](/v2.0/reference/flux/functions/built-in/transformations/join) merges two or more
|
||||
input streams, whose values are equal on a set of common columns, into a single output stream.
|
||||
Flux allows you to join on any columns common between two data streams and opens the door
|
||||
for operations such as cross-measurement joins and math across measurements.
|
||||
|
@ -205,7 +205,7 @@ These represent the columns with values unique to the two input tables.
|
|||
|
||||
## Calculate and create a new table
|
||||
With the two streams of data joined into a single table, use the
|
||||
[`map()` function](/v2.0/reference/flux/functions/transformations/map)
|
||||
[`map()` function](/v2.0/reference/flux/functions/built-in/transformations/map)
|
||||
to build a new table by mapping the existing `_time` column to a new `_time`
|
||||
column and dividing `_value_mem` by `_value_proc` and mapping it to a
|
||||
new `_value` column.
|
||||
|
|
|
@ -12,7 +12,7 @@ menu:
|
|||
weight: 206
|
||||
---
|
||||
|
||||
The [`sort()`function](/v2.0/reference/flux/functions/transformations/sort)
|
||||
The [`sort()`function](/v2.0/reference/flux/functions/built-in/transformations/sort)
|
||||
orders the records within each table.
|
||||
The following example orders system uptime first by region, then host, then value.
|
||||
|
||||
|
@ -26,7 +26,7 @@ from(bucket:"telegraf/autogen")
|
|||
|> sort(columns:["region", "host", "_value"])
|
||||
```
|
||||
|
||||
The [`limit()` function](/v2.0/reference/flux/functions/transformations/limit)
|
||||
The [`limit()` function](/v2.0/reference/flux/functions/built-in/transformations/limit)
|
||||
limits the number of records in output tables to a fixed number, `n`.
|
||||
The following example shows up to 10 records from the past hour.
|
||||
|
||||
|
@ -52,6 +52,6 @@ from(bucket:"telegraf/autogen")
|
|||
```
|
||||
|
||||
You now have created a Flux query that sorts and limits data.
|
||||
Flux also provides the [`top()`](/v2.0/reference/flux/functions/transformations/selectors/top)
|
||||
and [`bottom()`](/v2.0/reference/flux/functions/transformations/selectors/bottom)
|
||||
Flux also provides the [`top()`](/v2.0/reference/flux/functions/built-in/transformations/selectors/top)
|
||||
and [`bottom()`](/v2.0/reference/flux/functions/built-in/transformations/selectors/bottom)
|
||||
functions to perform both of these functions at the same time.
|
||||
|
|
|
@ -85,7 +85,7 @@ Table: keys: [_start, _stop, _field, _measurement]
|
|||
{{% /truncate %}}
|
||||
|
||||
## Windowing data
|
||||
Use the [`window()` function](/v2.0/reference/flux/functions/transformations/window)
|
||||
Use the [`window()` function](/v2.0/reference/flux/functions/built-in/transformations/window)
|
||||
to group your data based on time bounds.
|
||||
The most common parameter passed with the `window()` is `every` which
|
||||
defines the duration of time between windows.
|
||||
|
@ -169,14 +169,14 @@ When visualized in the InfluxDB UI, each window table is displayed in a differen
|
|||

|
||||
|
||||
## Aggregate data
|
||||
[Aggregate functions](/v2.0/reference/flux/functions/transformations/aggregates) take the values
|
||||
[Aggregate functions](/v2.0/reference/flux/functions/built-in/transformations/aggregates) take the values
|
||||
of all rows in a table and use them to perform an aggregate operation.
|
||||
The result is output as a new value in a single-row table.
|
||||
|
||||
Since windowed data is split into separate tables, aggregate operations run against
|
||||
each table separately and output new tables containing only the aggregated value.
|
||||
|
||||
For this example, use the [`mean()` function](/v2.0/reference/flux/functions/transformations/aggregates/mean)
|
||||
For this example, use the [`mean()` function](/v2.0/reference/flux/functions/built-in/transformations/aggregates/mean)
|
||||
to output the average of each window:
|
||||
|
||||
```js
|
||||
|
@ -240,7 +240,7 @@ These represent the lower and upper bounds of the time window.
|
|||
|
||||
Many Flux functions rely on the `_time` column.
|
||||
To further process your data after an aggregate function, you need to re-add `_time`.
|
||||
Use the [`duplicate()` function](/v2.0/reference/flux/functions/transformations/duplicate) to
|
||||
Use the [`duplicate()` function](/v2.0/reference/flux/functions/built-in/transformations/duplicate) to
|
||||
duplicate either the `_start` or `_stop` column as a new `_time` column.
|
||||
|
||||
```js
|
||||
|
@ -328,7 +328,7 @@ With the aggregate values in a single table, data points in the visualization ar
|
|||
You have now created a Flux query that windows and aggregates data.
|
||||
The data transformation process outlined in this guide should be used for all aggregation operations.
|
||||
|
||||
Flux also provides the [`aggregateWindow()` function](/v2.0/reference/flux/functions/transformations/aggregates/aggregatewindow)
|
||||
Flux also provides the [`aggregateWindow()` function](/v2.0/reference/flux/functions/built-in/transformations/aggregates/aggregatewindow)
|
||||
which performs all these separate functions for you.
|
||||
|
||||
The following Flux query will return the same results:
|
||||
|
|
|
@ -8,7 +8,7 @@ v2.0/tags: [cli]
|
|||
menu:
|
||||
v2_0_ref:
|
||||
name: Command line tools
|
||||
weight: 1
|
||||
weight: 2
|
||||
---
|
||||
|
||||
InfluxDB provides command line tools designed to aid in managing and working
|
||||
|
|
|
@ -5,7 +5,7 @@ v2.0/tags: [flux]
|
|||
menu:
|
||||
v2_0_ref:
|
||||
name: Flux query language
|
||||
weight: 2
|
||||
weight: 3
|
||||
---
|
||||
|
||||
The following articles are meant as a reference for Flux functions and the
|
||||
|
|
|
@ -10,7 +10,6 @@ weight: 101
|
|||
---
|
||||
|
||||
Flux's functional syntax allows you to retrieve, transform, process, and output data easily.
|
||||
There is a large library of built-in functions, but you can also create your own
|
||||
custom functions to perform operations that suit your needs.
|
||||
There is a large library of built-in and importable functions:
|
||||
|
||||
{{< children >}}
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
---
|
||||
title: Complete list of Flux functions
|
||||
description: View the full library of documented Flux functions.
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: View all functions
|
||||
parent: Flux functions
|
||||
weight: 299
|
||||
---
|
||||
|
||||
This list below contains all documented Flux functions:
|
||||
|
||||
{{< list-all-functions >}}
|
|
@ -0,0 +1,19 @@
|
|||
---
|
||||
title: Flux built-in functions
|
||||
description: >
|
||||
Built-in functions provide a necessary foundation for working with data using Flux.
|
||||
They do not require an import statement and are usable without any extra setup.
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: Built-in
|
||||
parent: Flux functions
|
||||
weight: 201
|
||||
v2.0/tags: [built-in]
|
||||
---
|
||||
|
||||
Built-in functions provide a necessary foundation for working with data using Flux.
|
||||
Because these functions are "built-in," they do not require an `import` statement and are usable without any extra setup.
|
||||
|
||||
Built-in functions are grouped into the following categories:
|
||||
|
||||
{{< children >}}
|
|
@ -0,0 +1,18 @@
|
|||
---
|
||||
title: Flux built-in input functions
|
||||
description: Flux's built-in input functions define sources of data or or display information about data sources.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/inputs
|
||||
menu:
|
||||
v2_0_ref:
|
||||
parent: Built-in
|
||||
name: Inputs
|
||||
identifier: built-in-inputs
|
||||
weight: 301
|
||||
v2.0/tags: [inputs]
|
||||
---
|
||||
|
||||
Flux's built-in input functions define sources of data or display information about data sources.
|
||||
The following input functions are available:
|
||||
|
||||
{{< children type="functions" >}}
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: buckets() function
|
||||
description: The buckets() function returns a list of buckets in the organization.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/inputs/buckets
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: buckets
|
||||
parent: Inputs
|
||||
weight: 301
|
||||
parent: built-in-inputs
|
||||
weight: 401
|
||||
---
|
||||
|
||||
The `buckets()` function returns a list of buckets in the organization.
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: from() function
|
||||
description: The from() function retrieves data from an InfluxDB data source.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/inputs/from
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: from
|
||||
parent: Inputs
|
||||
weight: 301
|
||||
parent: built-in-inputs
|
||||
weight: 401
|
||||
---
|
||||
|
||||
The `from()` function retrieves data from an InfluxDB data source.
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: fromCSV() function
|
||||
description: The fromCSV() function retrieves data from a CSV data source.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/inputs/fromcsv
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: fromCSV
|
||||
parent: Inputs
|
||||
weight: 301
|
||||
parent: built-in-inputs
|
||||
weight: 401
|
||||
---
|
||||
|
||||
The `fromCSV()` function retrieves data from a comma-separated value (CSV) data source.
|
|
@ -0,0 +1,20 @@
|
|||
---
|
||||
title: Flux built-in miscellaneous functions
|
||||
description: >
|
||||
Flux provides built-in miscellaneous functions that serve purposes other than
|
||||
retrieving, transforming, or outputting data.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/misc
|
||||
menu:
|
||||
v2_0_ref:
|
||||
parent: Built-in
|
||||
name: Miscellaneous
|
||||
identifier: built-in-misc
|
||||
weight: 305
|
||||
---
|
||||
|
||||
Flux's built-in functions primarily retrieve, shape and transform, then output data, however
|
||||
there are functions available that serve other purposes.
|
||||
The following functions are are available but don't fit within other function categories:
|
||||
|
||||
{{< children type="functions" >}}
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: intervals() function
|
||||
description: The intervals() function generates a set of time intervals over a range of time.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/misc/intervals
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: intervals
|
||||
parent: Miscellaneous
|
||||
weight: 301
|
||||
parent: built-in-misc
|
||||
weight: 401
|
||||
---
|
||||
|
||||
The `intervals()` function generates a set of time intervals over a range of time.
|
||||
|
@ -16,9 +18,13 @@ The generator is then used to produce the set of intervals.
|
|||
The set of intervals includes all intervals that intersect with the initial range of time.
|
||||
|
||||
{{% note %}}
|
||||
The `intervals()` function is designed to be used with the intervals parameter of the [`window()` function](/v2.0/reference/flux/functions/transformations/window).
|
||||
The `intervals()` function is designed to be used with the intervals parameter
|
||||
of the [`window()` function](/v2.0/reference/flux/functions/built-in/transformations/window).
|
||||
{{% /note %}}
|
||||
|
||||
By default the end boundary of an interval will align with the Unix epoch (zero time)
|
||||
modified by the offset of the `location` option.
|
||||
|
||||
_**Function type:** Miscellaneous_
|
||||
_**Output data type:** Object_
|
||||
|
||||
|
@ -44,9 +50,9 @@ Defaults to the value of the `every` duration.
|
|||
_**Data type:** Duration_
|
||||
|
||||
### offset
|
||||
The offset duration relative to the location offset.
|
||||
The duration by which to shift the window boundaries.
|
||||
It can be negative, indicating that the offset goes backwards in time.
|
||||
Defaults to `0h`.
|
||||
Defaults to `0`, which will align window end boundaries with the `every` duration.
|
||||
|
||||
_**Data type:** Duration_
|
||||
|
|
@ -1,16 +1,18 @@
|
|||
---
|
||||
title: linearBins() function
|
||||
description: The linearBins() function generates a list of linearly separated floats.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/misc/linearbins
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: linearBins
|
||||
parent: Miscellaneous
|
||||
weight: 301
|
||||
parent: built-in-misc
|
||||
weight: 401
|
||||
---
|
||||
|
||||
The `linearBins()` function generates a list of linearly separated floats.
|
||||
It is a helper function meant to generate bin bounds for the
|
||||
[`histogram()` function](/v2.0/reference/flux/functions/transformations/histogram).
|
||||
[`histogram()` function](/v2.0/reference/flux/functions/built-in/transformations/histogram).
|
||||
|
||||
_**Function type:** Miscellaneous_
|
||||
_**Output data type:** Array of floats_
|
|
@ -1,16 +1,18 @@
|
|||
---
|
||||
title: logarithmicBins() function
|
||||
description: The logarithmicBins() function generates a list of exponentially separated floats.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/misc/logarithmicbins
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: logarithmicBins
|
||||
parent: Miscellaneous
|
||||
weight: 301
|
||||
parent: built-in-misc
|
||||
weight: 401
|
||||
---
|
||||
|
||||
The `logarithmicBins()` function generates a list of exponentially separated floats.
|
||||
It is a helper function meant to generate bin bounds for the
|
||||
[`histogram()` function](/v2.0/reference/flux/functions/transformations/histogram).
|
||||
[`histogram()` function](/v2.0/reference/flux/functions/built-in/transformations/histogram).
|
||||
|
||||
_**Function type:** Miscellaneous_
|
||||
_**Output data type:** Array of floats_
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: systemTime() function
|
||||
description: The systemTime() function returns the current system time.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/misc/systemtime
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: systemTime
|
||||
parent: Miscellaneous
|
||||
weight: 301
|
||||
parent: built-in-misc
|
||||
weight: 401
|
||||
---
|
||||
|
||||
The `systemTime()` function returns the current system time.
|
|
@ -0,0 +1,18 @@
|
|||
---
|
||||
title: Flux built-in output functions
|
||||
description: Flux's built-in output functions yield results or send data to a specified output destination.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/outputs
|
||||
menu:
|
||||
v2_0_ref:
|
||||
parent: Built-in
|
||||
name: Outputs
|
||||
identifier: built-in-outputs
|
||||
weight: 302
|
||||
v2.0/tags: [outputs]
|
||||
---
|
||||
|
||||
Flux's built-in output functions yield results or send data to a specified output destination.
|
||||
The following output functions are are available:
|
||||
|
||||
{{< children type="functions" >}}
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: to() function
|
||||
description: The to() function writes data to an InfluxDB v2.0 bucket.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/outputs/to
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: to
|
||||
parent: Outputs
|
||||
weight: 301
|
||||
parent: built-in-outputs
|
||||
weight: 401
|
||||
---
|
||||
|
||||
The `to()` function writes data to an **InfluxDB v2.0** bucket.
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: yield() function
|
||||
description: The yield() function indicates the input tables received should be delivered as a result of the query.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/outputs/yield
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: yield
|
||||
parent: Outputs
|
||||
weight: 301
|
||||
parent: built-in-outputs
|
||||
weight: 401
|
||||
---
|
||||
|
||||
The `yield()` function indicates the input tables received should be delivered as a result of the query.
|
|
@ -0,0 +1,16 @@
|
|||
---
|
||||
title: Flux built-in testing functions
|
||||
description: Flux's built-in testing functions test various aspects of piped-forward data.
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: Tests
|
||||
identifier: built-in-tests
|
||||
parent: Built-in
|
||||
weight: 305
|
||||
v2.0/tags: [testing]
|
||||
---
|
||||
|
||||
Flux's built-in testing functions test various aspects of piped-forward data.
|
||||
The following built-in testing functions are available:
|
||||
|
||||
{{< children type="functions" show="pages" >}}
|
|
@ -0,0 +1,46 @@
|
|||
---
|
||||
title: contains() function
|
||||
description: The contains() function tests whether a value is a member of a set.
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: contains
|
||||
parent: built-in-tests
|
||||
weight: 401
|
||||
---
|
||||
|
||||
The `contains()` function tests whether a value is a member of a set.
|
||||
If the value is a member of the set, the function returns `true`.
|
||||
If the value is not a member of the set, the functions returns `false`.
|
||||
|
||||
```js
|
||||
contains(
|
||||
value: 1,
|
||||
set: [1,2,3]
|
||||
)
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
### value
|
||||
The value for which to search.
|
||||
|
||||
_**Data type:** Boolean | Integer | UInteger | Float | String | Time_
|
||||
|
||||
### set
|
||||
The set of values in which to search.
|
||||
|
||||
_**Data type:** Array of Booleans | Integers | UIntegers | Floats | Strings | Times_
|
||||
|
||||
## Examples
|
||||
|
||||
###### Filter on a set of specific fields
|
||||
```js
|
||||
fields = ["load1", "load5", "load15"]
|
||||
|
||||
from(bucket: "example-bucket")
|
||||
|> range(start:start, stop: stop)
|
||||
|> filter(fn: (r) =>
|
||||
r._measurement == "system" and
|
||||
contains(value: r._field, set: fields)
|
||||
)
|
||||
```
|
|
@ -0,0 +1,21 @@
|
|||
---
|
||||
title: Flux built-in transformation functions
|
||||
description: Flux's built-in transformation functions transform and shape your data in specific ways.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations
|
||||
menu:
|
||||
v2_0_ref:
|
||||
parent: Built-in
|
||||
name: Transformations
|
||||
identifier: built-in-transformations
|
||||
weight: 303
|
||||
---
|
||||
|
||||
Flux's built-in transformation functions transform or shape your data in specific ways.
|
||||
There are different types of transformations categorized below:
|
||||
|
||||
{{< children show="sections" >}}
|
||||
|
||||
## Generic transformations
|
||||
|
||||
{{< children type="functions" show="pages" >}}
|
|
@ -1,14 +1,17 @@
|
|||
---
|
||||
title: Flux aggregate functions
|
||||
description: Flux aggregate functions take values from an input table and aggregate them in some way.
|
||||
title: Flux built-in aggregate functions
|
||||
description: Flux's built-in aggregate functions take values from an input table and aggregate them in some way.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/aggregates
|
||||
menu:
|
||||
v2_0_ref:
|
||||
parent: Transformations
|
||||
parent: built-in-transformations
|
||||
name: Aggregates
|
||||
weight: 301
|
||||
identifier: built-in-aggregates
|
||||
weight: 401
|
||||
---
|
||||
|
||||
Flux aggregate functions take values from an input table and aggregate them in some way.
|
||||
Flux's built-in aggregate functions take values from an input table and aggregate them in some way.
|
||||
The output table contains is a single row with the aggregated value.
|
||||
|
||||
Aggregate operations output a table for every input table they receive.
|
||||
|
@ -25,7 +28,7 @@ Any output table will have the following properties:
|
|||
- It will not have a `_time` column.
|
||||
|
||||
### aggregateWindow helper function
|
||||
The [`aggregateWindow()` function](/v2.0/reference/flux/functions/transformations/aggregates/aggregatewindow)
|
||||
The [`aggregateWindow()` function](/v2.0/reference/flux/functions/built-in/transformations/aggregates/aggregatewindow)
|
||||
does most of the work needed when aggregating data.
|
||||
It windows and aggregates the data, then combines windowed tables into a single output table.
|
||||
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: aggregateWindow() function
|
||||
description: The aggregateWindow() function applies an aggregate function to fixed windows of time.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/aggregates/aggregatewindow
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: aggregateWindow
|
||||
parent: Aggregates
|
||||
weight: 401
|
||||
parent: built-in-aggregates
|
||||
weight: 501
|
||||
---
|
||||
|
||||
The `aggregateWindow()` function applies an aggregate function to fixed windows of time.
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: count() function
|
||||
description: The count() function outputs the number of non-null records in each aggregated column.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/aggregates/count
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: count
|
||||
parent: Aggregates
|
||||
weight: 401
|
||||
parent: built-in-aggregates
|
||||
weight: 501
|
||||
---
|
||||
|
||||
The `count()` function outputs the number of records in each aggregated column.
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: cov() function
|
||||
description: The cov() function computes the covariance between two streams by first joining the streams, then performing the covariance operation.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/aggregates/cov
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: cov
|
||||
parent: Aggregates
|
||||
weight: 401
|
||||
parent: built-in-aggregates
|
||||
weight: 501
|
||||
---
|
||||
|
||||
The `cov()` function computes the covariance between two streams by first joining the streams,
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: covariance() function
|
||||
description: The covariance() function computes the covariance between two columns.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/aggregates/covariance
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: covariance
|
||||
parent: Aggregates
|
||||
weight: 401
|
||||
parent: built-in-aggregates
|
||||
weight: 501
|
||||
---
|
||||
|
||||
The `covariance()` function computes the covariance between two columns.
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: derivative() function
|
||||
description: The derivative() function computes the rate of change per unit of time between subsequent non-null records.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/aggregates/derivative
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: derivative
|
||||
parent: Aggregates
|
||||
weight: 401
|
||||
parent: built-in-aggregates
|
||||
weight: 501
|
||||
---
|
||||
|
||||
The `derivative()` function computes the rate of change per [`unit`](#unit) of time between subsequent non-null records.
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: difference() function
|
||||
description: The difference() function computes the difference between subsequent non-null records.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/aggregates/difference
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: difference
|
||||
parent: Aggregates
|
||||
weight: 401
|
||||
parent: built-in-aggregates
|
||||
weight: 501
|
||||
---
|
||||
|
||||
The `difference()` function computes the difference between subsequent records.
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: histogramQuantile() function
|
||||
description: The `histogramQuantile()` function approximates a quantile given a histogram that approximates the cumulative distribution of the dataset.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/aggregates/histogramquantile
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: histogramQuantile
|
||||
parent: Aggregates
|
||||
weight: 401
|
||||
parent: built-in-aggregates
|
||||
weight: 501
|
||||
---
|
||||
|
||||
The `histogramQuantile()` function approximates a quantile given a histogram that
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: increase() function
|
||||
description: The increase() function calculates the total non-negative difference between values in a table.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/aggregates/increase
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: increase
|
||||
parent: Aggregates
|
||||
weight: 401
|
||||
parent: built-in-aggregates
|
||||
weight: 501
|
||||
---
|
||||
|
||||
The `increase()` function calculates the total non-negative difference between values in a table.
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: integral() function
|
||||
description: The integral() function computes the area under the curve per unit of time of subsequent non-null records.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/aggregates/integral
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: integral
|
||||
parent: Aggregates
|
||||
weight: 401
|
||||
parent: built-in-aggregates
|
||||
weight: 501
|
||||
---
|
||||
|
||||
The `integral()` function computes the area under the curve per [`unit`](#unit) of time of subsequent non-null records.
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: mean() function
|
||||
description: The mean() function computes the mean or average of non-null records in the input table.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/aggregates/mean
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: mean
|
||||
parent: Aggregates
|
||||
weight: 401
|
||||
parent: built-in-aggregates
|
||||
weight: 501
|
||||
---
|
||||
|
||||
The `mean()` function computes the mean or average of non-null records in the input table.
|
|
@ -1,14 +1,16 @@
|
|||
---
|
||||
title: median() function
|
||||
description: The `median()` function returns the median `_value` of an input table or all non-null records in the input table with values that fall within the 50th percentile.
|
||||
description: The `median()` function returns the median `_value` of an input table or all non-null records in the input table with values that fall within the 50th percentile
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/aggregates/median
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: median
|
||||
parent: Aggregates
|
||||
weight: 401
|
||||
parent: built-in-aggregates
|
||||
weight: 501
|
||||
---
|
||||
|
||||
The `median()` function is a special application of the [`percentile()` function](/v2.0/reference/flux/functions/transformations/aggregates/percentile)
|
||||
The `median()` function is a special application of the [`percentile()` function](/v2.0/reference/flux/functions/built-in/transformations/aggregates/percentile)
|
||||
that returns the median `_value` of an input table or all non-null records in the input table
|
||||
with values that fall within the 50th percentile depending on the [method](#method) used.
|
||||
|
||||
|
@ -28,9 +30,9 @@ value that represents the 50th percentile.
|
|||
|
||||
{{% note %}}
|
||||
The `median()` function can only be used with float value types.
|
||||
It is a special application of the [`percentile()` function](/v2.0/reference/flux/functions/transformations/aggregates/percentile) which
|
||||
It is a special application of the [`percentile()` function](/v2.0/reference/flux/functions/built-in/transformations/aggregates/percentile) which
|
||||
uses an approximation implementation that requires floats.
|
||||
You can convert your value column to a float column using the [`toFloat()` function](/v2.0/reference/flux/functions/transformations/type-conversions/tofloat).
|
||||
You can convert your value column to a float column using the [`toFloat()` function](/v2.0/reference/flux/functions/built-in/transformations/type-conversions/tofloat).
|
||||
{{% /note %}}
|
||||
|
||||
## Parameters
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: pearsonr() function
|
||||
description: The pearsonr() function computes the Pearson R correlation coefficient between two streams by first joining the streams, then performing the covariance operation normalized to compute R.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/aggregates/pearsonr
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: pearsonr
|
||||
parent: Aggregates
|
||||
weight: 401
|
||||
parent: built-in-aggregates
|
||||
weight: 501
|
||||
---
|
||||
|
||||
The `pearsonr()` function computes the Pearson R correlation coefficient between two streams
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: percentile() function
|
||||
description: The percentile() function outputs non-null records with values that fall within the specified percentile or the non-null record with the value that represents the specified percentile.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/aggregates/percentile
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: percentile
|
||||
parent: Aggregates
|
||||
weight: 401
|
||||
parent: built-in-aggregates
|
||||
weight: 501
|
||||
---
|
||||
|
||||
The `percentile()` function returns records from an input table with `_value`s that fall within
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: skew() function
|
||||
description: The skew() function outputs the skew of non-null records as a float.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/aggregates/skew
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: skew
|
||||
parent: Aggregates
|
||||
weight: 401
|
||||
parent: built-in-aggregates
|
||||
weight: 501
|
||||
---
|
||||
|
||||
The `skew()` function outputs the skew of non-null records as a float.
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: spread() function
|
||||
description: The spread() function outputs the difference between the minimum and maximum values in each specified column.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/aggregates/spread
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: spread
|
||||
parent: Aggregates
|
||||
weight: 401
|
||||
parent: built-in-aggregates
|
||||
weight: 501
|
||||
---
|
||||
|
||||
The `spread()` function outputs the difference between the minimum and maximum values in each specified column.
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: stddev() function
|
||||
description: The stddev() function computes the standard deviation of non-null records in specified columns.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/aggregates/stddev
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: stddev
|
||||
parent: Aggregates
|
||||
weight: 401
|
||||
parent: built-in-aggregates
|
||||
weight: 501
|
||||
---
|
||||
|
||||
The `stddev()` function computes the standard deviation of non-null records in specified columns.
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: sum() function
|
||||
description: The sum() function computes the sum of non-null records in specified columns.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/aggregates/sum
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: sum
|
||||
parent: Aggregates
|
||||
weight: 401
|
||||
parent: built-in-aggregates
|
||||
weight: 501
|
||||
---
|
||||
|
||||
The `sum()` function computes the sum of non-null records in specified columns.
|
|
@ -3,12 +3,14 @@ title: columns() function
|
|||
description: >
|
||||
The columns() function lists the column labels of input tables.
|
||||
For each input table, it outputs a table with the same group key columns,
|
||||
plus a new column containing the labels of the input table's columns.
|
||||
plus a new column containing the labels of the input table's columns.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/columns
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: columns
|
||||
parent: Transformations
|
||||
weight: 301
|
||||
parent: built-in-transformations
|
||||
weight: 401
|
||||
---
|
||||
|
||||
The `columns()` function lists the column labels of input tables.
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: cumulativeSum() function
|
||||
description: The cumulativeSum() function computes a running sum for non-null records in the table.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/cumulativesum
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: cumulativeSum
|
||||
parent: Transformations
|
||||
weight: 301
|
||||
parent: built-in-transformations
|
||||
weight: 401
|
||||
---
|
||||
|
||||
The `cumulativeSum()` function computes a running sum for non-null records in the table.
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: drop() function
|
||||
description: The drop() function removes specified columns from a table.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/drop
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: drop
|
||||
parent: Transformations
|
||||
weight: 301
|
||||
parent: built-in-transformations
|
||||
weight: 401
|
||||
---
|
||||
|
||||
The `drop()` function removes specified columns from a table.
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: duplicate() function
|
||||
description: The duplicate() function duplicates a specified column in a table.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/duplicate
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: duplicate
|
||||
parent: Transformations
|
||||
weight: 301
|
||||
parent: built-in-transformations
|
||||
weight: 401
|
||||
---
|
||||
|
||||
The `duplicate()` function duplicates a specified column in a table.
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: fill() function
|
||||
description: The fill() function replaces all null values in an input stream and replace them with a non-null value.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/fill
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: fill
|
||||
parent: Transformations
|
||||
weight: 301
|
||||
parent: built-in-transformations
|
||||
weight: 401
|
||||
---
|
||||
|
||||
The `fill()` function replaces all null values in an input stream with a non-null value.
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: filter() function
|
||||
description: The filter() function filters data based on conditions defined in a predicate function (fn).
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/filter
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: filter
|
||||
parent: Transformations
|
||||
weight: 301
|
||||
parent: built-in-transformations
|
||||
weight: 401
|
||||
---
|
||||
|
||||
The `filter()` function filters data based on conditions defined in a predicate function ([`fn`](#fn)).
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: group() function
|
||||
description: The group() function groups records based on their values for specific columns.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/group
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: group
|
||||
parent: Transformations
|
||||
weight: 301
|
||||
parent: built-in-transformations
|
||||
weight: 401
|
||||
---
|
||||
|
||||
The `group()` function groups records based on their values for specific columns.
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: histogram() function
|
||||
description: The histogram() function approximates the cumulative distribution of a dataset by counting data frequencies for a list of bins.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/histogram
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: histogram
|
||||
parent: Transformations
|
||||
weight: 301
|
||||
parent: built-in-transformations
|
||||
weight: 401
|
||||
---
|
||||
|
||||
The `histogram()` function approximates the cumulative distribution of a dataset by counting data frequencies for a list of bins.
|
||||
|
@ -54,8 +56,8 @@ _**Data type:** Array of floats_
|
|||
#### Bin helper functions
|
||||
The following helper functions can be used to generated bins.
|
||||
|
||||
[linearBins()](/v2.0/reference/flux/functions/misc/linearbins)
|
||||
[logarithmicBins()](/v2.0/reference/flux/functions/misc/logarithmicbins)
|
||||
[linearBins()](/v2.0/reference/flux/functions/built-in/misc/linearbins)
|
||||
[logarithmicBins()](/v2.0/reference/flux/functions/built-in/misc/logarithmicbins)
|
||||
|
||||
### normalize
|
||||
When `true`, will convert the counts into frequency values between 0 and 1.
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: join() function
|
||||
description: The join() function merges two or more input streams whose values are equal on a set of common columns into a single output stream.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/join
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: join
|
||||
parent: Transformations
|
||||
weight: 301
|
||||
parent: built-in-transformations
|
||||
weight: 401
|
||||
---
|
||||
|
||||
The `join()` function merges two or more input streams whose values are equal on
|
|
@ -1,16 +1,18 @@
|
|||
---
|
||||
title: keep() function
|
||||
description: The keep() function returns a table containing only the specified columns.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/keep
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: keep
|
||||
parent: Transformations
|
||||
weight: 301
|
||||
parent: built-in-transformations
|
||||
weight: 401
|
||||
---
|
||||
|
||||
The `keep()` function returns a table containing only the specified columns, ignoring all others.
|
||||
Only columns in the group key that are also specified in the `keep()` function will be kept in the resulting group key.
|
||||
_It is the inverse of [`drop`](/v2.0/reference/flux/functions/transformations/drop)._
|
||||
_It is the inverse of [`drop`](/v2.0/reference/flux/functions/built-in/transformations/drop)._
|
||||
|
||||
_**Function type:** Transformation_
|
||||
_**Output data type:** Object_
|
|
@ -3,12 +3,14 @@ title: keys() function
|
|||
description: >
|
||||
The keys() function outputs the group key of input tables.
|
||||
For each input table, it outputs a table with the same group key columns, plus a
|
||||
_value column containing the labels of the input table's group key.
|
||||
_value column containing the labels of the input table's group key.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/keys
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: keys
|
||||
parent: Transformations
|
||||
weight: 301
|
||||
parent: built-in-transformations
|
||||
weight: 401
|
||||
---
|
||||
|
||||
The `keys()` function outputs the group key of input tables.
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: keyValues() function
|
||||
description: The keyValues() function returns a table with the input table's group key plus two columns, _key and _value, that correspond to unique column + value pairs from the input table.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/keyvalues
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: keyValues
|
||||
parent: Transformations
|
||||
weight: 301
|
||||
parent: built-in-transformations
|
||||
weight: 401
|
||||
---
|
||||
|
||||
The `keyValues()` function returns a table with the input table's group key plus two columns,
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: limit() function
|
||||
description: The limit() function limits the number of records in output tables to a fixed number (n).
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/limit
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: limit
|
||||
parent: Transformations
|
||||
weight: 301
|
||||
parent: built-in-transformations
|
||||
weight: 401
|
||||
---
|
||||
|
||||
The `limit()` function limits the number of records in output tables to a fixed number ([`n`](#n)).
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: map() function
|
||||
description: The map() function applies a function to each record in the input tables.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/map
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: map
|
||||
parent: Transformations
|
||||
weight: 301
|
||||
parent: built-in-transformations
|
||||
weight: 401
|
||||
---
|
||||
|
||||
The `map()` function applies a function to each record in the input tables.
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: pivot() function
|
||||
description: The pivot() function collects values stored vertically (column-wise) in a table and aligns them horizontally (row-wise) into logical sets.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/pivot
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: pivot
|
||||
parent: Transformations
|
||||
weight: 301
|
||||
parent: built-in-transformations
|
||||
weight: 401
|
||||
---
|
||||
|
||||
The `pivot()` function collects values stored vertically (column-wise) in a table
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: range() function
|
||||
description: The range() function filters records based on time bounds.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/range
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: range
|
||||
parent: Transformations
|
||||
weight: 301
|
||||
parent: built-in-transformations
|
||||
weight: 401
|
||||
---
|
||||
|
||||
The `range()` function filters records based on time bounds.
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: rename() function
|
||||
description: The rename() function renames specified columns in a table.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/rename
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: rename
|
||||
parent: Transformations
|
||||
weight: 301
|
||||
parent: built-in-transformations
|
||||
weight: 401
|
||||
---
|
||||
|
||||
The `rename()` function renames specified columns in a table.
|
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
title: Flux built-in selector functions
|
||||
description: Flux's built-in selector functions return one or more records based on function logic.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/selectors
|
||||
menu:
|
||||
v2_0_ref:
|
||||
parent: built-in-transformations
|
||||
name: Selectors
|
||||
identifier: built-in-selectors
|
||||
weight: 401
|
||||
---
|
||||
|
||||
Flux's built-in selector functions return one or more records based on function logic.
|
||||
The output table is different than the input table, but individual row values are not.
|
||||
|
||||
The following selector functions are available:
|
||||
|
||||
{{< children type="functions" >}}
|
||||
|
||||
|
||||
### Selectors and aggregates
|
||||
The following functions can be used as both selectors or aggregates, but they are
|
||||
categorized as aggregate functions in this documentation:
|
||||
|
||||
- [median](/v2.0/reference/flux/functions/built-in/transformations/aggregates/median)
|
||||
- [percentile](/v2.0/reference/flux/functions/built-in/transformations/aggregates/percentile)
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: bottom() function
|
||||
description: The bottom() function sorts a table by columns and keeps only the bottom n records.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/selectors/bottom
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: bottom
|
||||
parent: Selectors
|
||||
weight: 401
|
||||
parent: built-in-selectors
|
||||
weight: 501
|
||||
---
|
||||
|
||||
The `bottom()` function sorts a table by columns and keeps only the bottom `n` records.
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: distinct() function
|
||||
description: The distinct() function returns the unique values for a given column.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/selectors/distinct
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: distinct
|
||||
parent: Selectors
|
||||
weight: 401
|
||||
parent: built-in-selectors
|
||||
weight: 501
|
||||
---
|
||||
|
||||
The `distinct()` function returns the unique values for a given column.
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: first() function
|
||||
description: The first() function selects the first non-null record from an input table.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/selectors/first
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: first
|
||||
parent: Selectors
|
||||
weight: 401
|
||||
parent: built-in-selectors
|
||||
weight: 501
|
||||
---
|
||||
|
||||
The `first()` function selects the first non-null record from an input table.
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: highestAverage() function
|
||||
description: The highestAverage() function returns the top 'n' records from all groups using the average of each group.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/selectors/highestaverage
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: highestAverage
|
||||
parent: Selectors
|
||||
weight: 401
|
||||
parent: built-in-selectors
|
||||
weight: 501
|
||||
---
|
||||
|
||||
The `highestAverage()` function returns the top `n` records from all groups using the average of each group.
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: highestCurrent() function
|
||||
description: The highestCurrent() function returns the top 'n' records from all groups using the last value of each group.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/selectors/highestcurrent
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: highestCurrent
|
||||
parent: Selectors
|
||||
weight: 401
|
||||
parent: built-in-selectors
|
||||
weight: 501
|
||||
---
|
||||
|
||||
The `highestCurrent()` function returns the top `n` records from all groups using the last value of each group.
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: highestMax() function
|
||||
description: The highestMax() function returns the top 'n' records from all groups using the maximum of each group.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/selectors/highestmax
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: highestMax
|
||||
parent: Selectors
|
||||
weight: 401
|
||||
parent: built-in-selectors
|
||||
weight: 501
|
||||
---
|
||||
|
||||
The `highestMax()` function returns the top `n` records from all groups using the maximum of each group.
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: last() function
|
||||
description: The last() function selects the last non-null record from an input table.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/selectors/last
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: last
|
||||
parent: Selectors
|
||||
weight: 401
|
||||
parent: built-in-selectors
|
||||
weight: 501
|
||||
---
|
||||
|
||||
The `last()` function selects the last non-null record from an input table.
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: lowestAverage() function
|
||||
description: The lowestAverage() function returns the bottom 'n' records from all groups using the average of each group.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/selectors/lowestaverage
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: lowestAverage
|
||||
parent: Selectors
|
||||
weight: 401
|
||||
parent: built-in-selectors
|
||||
weight: 501
|
||||
---
|
||||
|
||||
The `lowestAverage()` function returns the bottom `n` records from all groups using the average of each group.
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: lowestCurrent() function
|
||||
description: The lowestCurrent() function returns the bottom 'n' records from all groups using the last value of each group.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/selectors/lowestcurrent
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: lowestCurrent
|
||||
parent: Selectors
|
||||
weight: 401
|
||||
parent: built-in-selectors
|
||||
weight: 501
|
||||
---
|
||||
|
||||
The `lowestCurrent()` function returns the bottom `n` records from all groups using the last value of each group.
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: lowestMin() function
|
||||
description: The lowestMin() function returns the bottom 'n' records from all groups using the minimum of each group.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/selectors/lowestmin
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: lowestMin
|
||||
parent: Selectors
|
||||
weight: 401
|
||||
parent: built-in-selectors
|
||||
weight: 501
|
||||
---
|
||||
|
||||
The `lowestMin()` function returns the bottom `n` records from all groups using the minimum of each group.
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: max() function
|
||||
description: The max() function selects record with the highest _value from the input table.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/selectors/max
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: max
|
||||
parent: Selectors
|
||||
weight: 401
|
||||
parent: built-in-selectors
|
||||
weight: 501
|
||||
---
|
||||
|
||||
The `max()` function selects record with the highest `_value` from the input table.
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: min() function
|
||||
description: The min() function selects record with the lowest _value from the input table.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/selectors/min
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: min
|
||||
parent: Selectors
|
||||
weight: 401
|
||||
parent: built-in-selectors
|
||||
weight: 501
|
||||
---
|
||||
|
||||
The `min()` function selects record with the lowest `_value` from the input table.
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: sample() function
|
||||
description: The sample() function selects a subset of the records from the input table.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/selectors/sample
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: sample
|
||||
parent: Selectors
|
||||
weight: 401
|
||||
parent: built-in-selectors
|
||||
weight: 501
|
||||
---
|
||||
|
||||
The `sample()` function selects a subset of the records from the input table.
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: top() function
|
||||
description: The top() function sorts a table by columns and keeps only the top n records.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/selectors/top
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: top
|
||||
parent: Selectors
|
||||
weight: 401
|
||||
parent: built-in-selectors
|
||||
weight: 501
|
||||
---
|
||||
|
||||
The `top()` function sorts a table by columns and keeps only the top `n` records.
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: unique() function
|
||||
description: The unique() function returns all records containing unique values in a specified column.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/selectors/unique
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: unique
|
||||
parent: Selectors
|
||||
weight: 401
|
||||
parent: built-in-selectors
|
||||
weight: 501
|
||||
---
|
||||
|
||||
The `unique()` function returns all records containing unique values in a specified column.
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: set() function
|
||||
description: The set() function assigns a static value to each record in the input table.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/set
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: set
|
||||
parent: Transformations
|
||||
weight: 301
|
||||
parent: built-in-transformations
|
||||
weight: 401
|
||||
---
|
||||
|
||||
The `set()` function assigns a static value to each record in the input table.
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: shift() function
|
||||
description: The shift() function adds a fixed duration to time columns.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/shift
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: shift
|
||||
parent: Transformations
|
||||
weight: 301
|
||||
parent: built-in-transformations
|
||||
weight: 401
|
||||
---
|
||||
|
||||
The `shift()` function adds a fixed duration to time columns.
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: sort() function
|
||||
description: The sort() function orders the records within each table.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/sort
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: sort
|
||||
parent: Transformations
|
||||
weight: 301
|
||||
parent: built-in-transformations
|
||||
weight: 401
|
||||
---
|
||||
|
||||
The `sort()` function orders the records within each table.
|
|
@ -1,16 +1,18 @@
|
|||
---
|
||||
title: stateCount() function
|
||||
description: The stateCount() function computes the number of consecutive records in a given state.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/statecount
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: stateCount
|
||||
parent: Transformations
|
||||
weight: 301
|
||||
parent: built-in-transformations
|
||||
weight: 401
|
||||
---
|
||||
|
||||
The `stateCount()` function computes the number of consecutive records in a given state.
|
||||
The state is defined via the function `fn`.
|
||||
For each consecutive point that evaluates as `true`, the state count will be incremented.
|
||||
For each consecutive point that evaluates as `true`, the state count is incremented.
|
||||
When a point evaluates as `false`, the state count is reset.
|
||||
The state count is added as an additional column to each record.
|
||||
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: stateDuration() function
|
||||
description: The stateDuration() function computes the duration of a given state.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/stateduration
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: stateDuration
|
||||
parent: Transformations
|
||||
weight: 301
|
||||
parent: built-in-transformations
|
||||
weight: 401
|
||||
---
|
||||
|
||||
The `stateDuration()` function computes the duration of a given state.
|
|
@ -0,0 +1,17 @@
|
|||
---
|
||||
title: Flux built-in type conversion functions
|
||||
description: Flux's built-in built-in type conversion functions convert columns of the input table into a specific data type.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/type-conversions
|
||||
menu:
|
||||
v2_0_ref:
|
||||
parent: built-in-transformations
|
||||
name: Type conversions
|
||||
identifier: built-in-type-conversions
|
||||
weight: 401
|
||||
---
|
||||
|
||||
Flux's built-in type conversion functions convert columns of the input table into a specific data type.
|
||||
The following type conversion functions are available:
|
||||
|
||||
{{< children type="functions" >}}
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: toBool() function
|
||||
description: The toBool() function converts a value to a boolean.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/type-conversions/tobool
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: toBool
|
||||
parent: Type conversions
|
||||
weight: 401
|
||||
parent: built-in-type-conversions
|
||||
weight: 501
|
||||
---
|
||||
|
||||
The `toBool()` function converts a value to a boolean.
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: toDuration() function
|
||||
description: The toDuration() function converts a value to a duration.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/type-conversions/toduration
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: toDuration
|
||||
parent: Type conversions
|
||||
weight: 401
|
||||
parent: built-in-type-conversions
|
||||
weight: 501
|
||||
---
|
||||
|
||||
The `toDuration()` function converts a value to a duration.
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: toFloat() function
|
||||
description: The toFloat() function converts a value to a float.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/type-conversions/tofloat
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: toFloat
|
||||
parent: Type conversions
|
||||
weight: 401
|
||||
parent: built-in-type-conversions
|
||||
weight: 501
|
||||
---
|
||||
|
||||
The `toFloat()` function converts a value to a float.
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: toInt() function
|
||||
description: The toInt() function converts a value to an integer.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/type-conversions/toint
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: toInt
|
||||
parent: Type conversions
|
||||
weight: 401
|
||||
parent: built-in-type-conversions
|
||||
weight: 501
|
||||
---
|
||||
|
||||
The `toInt()` function converts a value to an integer.
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: toString() function
|
||||
description: The toString() function converts a value to a string.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/type-conversions/tostring
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: toString
|
||||
parent: Type conversions
|
||||
weight: 401
|
||||
parent: built-in-type-conversions
|
||||
weight: 501
|
||||
---
|
||||
|
||||
The `toString()` function converts a value to a string.
|
|
@ -1,11 +1,13 @@
|
|||
---
|
||||
title: toTime() function
|
||||
description: The toTime() function converts a value to a time.
|
||||
aliases:
|
||||
- /v2.0/reference/flux/functions/transformations/type-conversions/totime
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: toTime
|
||||
parent: Type conversions
|
||||
weight: 401
|
||||
parent: built-in-type-conversions
|
||||
weight: 501
|
||||
---
|
||||
|
||||
The `toTime()` function converts a value to a time.
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue