Merge pull request #454 from influxdata/flux/directory-restructure

Flux documentation directory restructure
pull/460/head
Scott Anderson 2019-09-11 14:43:01 -06:00 committed by GitHub
commit 102c6bf1ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
308 changed files with 802 additions and 327 deletions

View File

@ -117,7 +117,7 @@ The primary differences between InfluxDB OSS 2.0 and InfluxDB Cloud 2.0 are:
targets are not available in {{< cloud-name "short" >}}.
- {{< cloud-name "short" >}} instances are currently limited to a single organization with a single user.
- Retrieving data from a file based CSV source using the `file` parameter of the
[`csv.from()`](/v2/reference/flux/functions/csv/from) function is not supported;
[`csv.from()`](/v2.0/reference/flux/functions/csv/from) function is not supported;
however you can use raw CSV data with the `csv` parameter.
- Multi-organization accounts and multi-user organizations are currently not
available in {{< cloud-name >}}.

View File

@ -82,7 +82,7 @@ A check consists of two parts a query and check configuration.
{{% note %}}
#### Flux only interpolates string values
Flux currently interpolates only string values.
Use the [string() function](/v2.0/reference/flux/functions/built-in/transformations/type-conversions/string/)
Use the [string() function](/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/string/)
to convert non-string values to strings.
```js

View File

@ -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/built-in/transformations/aggregates/)
View [Flux's aggregate functions](/v2.0/reference/flux/stdlib/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/built-in/transformations/aggregates/aggregatewindow/)
3. Uses the [`aggregateWindow()` function](/v2.0/reference/flux/stdlib/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.

View File

@ -54,8 +54,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/built-in/inputs/from/)
or any other [Flux input functions](/v2.0/reference/flux/functions/built-in/inputs/).
Define a data source using Flux's [`from()` function](/v2.0/reference/flux/stdlib/built-in/inputs/from/)
or any other [Flux input functions](/v2.0/reference/flux/stdlib/built-in/inputs/).
For convenience, consider creating a variable that includes the sourced data with
the required time range and any relevant filters.
@ -88,7 +88,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/built-in/transformations/aggregates/aggregatewindow/).
window using the [`aggregateWindow()` function](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/aggregatewindow/).
```js
data
@ -104,7 +104,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/built-in/outputs/to)
The example below uses Flux's [`to()` function](/v2.0/reference/flux/stdlib/built-in/outputs/to)
to send the transformed data to another bucket:
```js

View File

@ -11,7 +11,7 @@ menu:
parent: Query data
related:
- /v2.0/reference/flux/
- /v2.0/reference/flux/functions/
- /v2.0/reference/flux/stdlib/
---
Flux is InfluxData's functional data scripting language designed for querying,

View File

@ -9,9 +9,9 @@ menu:
weight: 201
related:
- /v2.0/query-data/guides/
- /v2.0/reference/flux/functions/built-in/inputs/from
- /v2.0/reference/flux/functions/built-in/transformations/range
- /v2.0/reference/flux/functions/built-in/transformations/filter
- /v2.0/reference/flux/stdlib/built-in/inputs/from
- /v2.0/reference/flux/stdlib/built-in/transformations/range
- /v2.0/reference/flux/stdlib/built-in/transformations/filter
---
This guide walks through the basics of using Flux to query data from InfluxDB.
@ -23,8 +23,8 @@ Every Flux query needs the following:
## 1. Define your data source
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.
Flux's [`from()`](/v2.0/reference/flux/stdlib/built-in/inputs/from) function defines an InfluxDB data source.
It requires a [`bucket`](/v2.0/reference/flux/stdlib/built-in/inputs/from#bucket) parameter.
The following examples use `example-bucket` as the bucket name.
```js
@ -36,7 +36,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/built-in/transformations/range)
Use the pipe-forward operator (`|>`) to pipe data from your data source into the [`range()`](/v2.0/reference/flux/stdlib/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)

View File

@ -8,15 +8,15 @@ menu:
parent: Get started with Flux
weight: 202
related:
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/aggregatewindow
- /v2.0/reference/flux/functions/built-in/transformations/window
- /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/aggregatewindow
- /v2.0/reference/flux/stdlib/built-in/transformations/window
---
When [querying data from InfluxDB](/v2.0/query-data/get-started/query-influxdb),
you often need to transform that data in some way.
Common examples are aggregating data into averages, downsampling data, etc.
This guide demonstrates using [Flux functions](/v2.0/reference/flux/functions) to transform your data.
This guide demonstrates using [Flux functions](/v2.0/reference/flux/stdlib) to transform your data.
It walks through creating a Flux script that partitions data into windows of time,
averages the `_value`s in each window, and outputs the averages as a new table.
@ -39,13 +39,13 @@ from(bucket:"example-bucket")
## Flux functions
Flux provides a number of functions that perform specific operations, transformations, and tasks.
You can also [create custom functions](/v2.0/query-data/guides/custom-functions) in your Flux queries.
_Functions are covered in detail in the [Flux functions](/v2.0/reference/flux/functions) documentation._
_Functions are covered in detail in the [Flux functions](/v2.0/reference/flux/stdlib) documentation._
A common type of function used when transforming data queried from InfluxDB is an aggregate function.
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/built-in/transformations/aggregates/mean)
This example uses the [`mean()` function](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/mean)
to average values within each time window.
{{% note %}}
@ -55,7 +55,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/built-in/transformations/window) partitions records based on a time value.
Flux's [`window()` function](/v2.0/reference/flux/stdlib/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`).
@ -78,7 +78,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/built-in/transformations/aggregates/mean) to average the `_value`s of each table.
Use the [`mean()` function](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/mean) to average the `_value`s of each table.
```js
from(bucket:"example-bucket")
@ -104,7 +104,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/built-in/transformations/duplicate)
To add one, use the [`duplicate()` function](/v2.0/reference/flux/stdlib/built-in/transformations/duplicate)
to duplicate the `_stop` column as the `_time` column for each windowed table.
```js
@ -149,7 +149,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/built-in/transformations/aggregates/aggregatewindow).
[`aggregateWindow()` function](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/aggregatewindow).
```js
from(bucket:"example-bucket")

View File

@ -27,9 +27,9 @@ Conditional expressions are most useful in the following contexts:
- When defining variables.
- When using functions that operate on a single row at a time (
[`filter()`](/v2.0/reference/flux/functions/built-in/transformations/filter/),
[`map()`](/v2.0/reference/flux/functions/built-in/transformations/map/),
[`reduce()`](/v2.0/reference/flux/functions/built-in/transformations/aggregates/reduce) ).
[`filter()`](/v2.0/reference/flux/stdlib/built-in/transformations/filter/),
[`map()`](/v2.0/reference/flux/stdlib/built-in/transformations/map/),
[`reduce()`](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/reduce) ).
## Examples
@ -72,7 +72,7 @@ from(bucket: "example-bucket")
### Conditionally transform column values with map()
The following example uses the [`map()` function](/v2.0/reference/flux/functions/built-in/transformations/map/)
The following example uses the [`map()` function](/v2.0/reference/flux/stdlib/built-in/transformations/map/)
to conditionally transform column values.
It sets the `level` column to a specific string based on `_value` column.
@ -119,8 +119,8 @@ from(bucket: "example-bucket")
{{< /code-tabs-wrapper >}}
### Conditionally increment a count with reduce()
The following example uses the [`aggregateWindow()`](/v2.0/reference/flux/functions/built-in/transformations/aggregates/aggregatewindow/)
and [`reduce()`](/v2.0/reference/flux/functions/built-in/transformations/aggregates/reduce/)
The following example uses the [`aggregateWindow()`](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/aggregatewindow/)
and [`reduce()`](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/reduce/)
functions to count the number of records in every five minute window that exceed a defined threshold.
{{< code-tabs-wrapper >}}

View File

@ -70,7 +70,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/built-in/transformations/map)
It uses the [`map()` function](/v2.0/reference/flux/stdlib/built-in/transformations/map)
to modify each `_value`.
```js
@ -104,9 +104,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/built-in/transformations/sort)
It uses the [`sort()` function](/v2.0/reference/flux/stdlib/built-in/transformations/sort)
to sort records in either descending or ascending order.
It then uses the [`limit()` function](/v2.0/reference/flux/functions/built-in/transformations/limit)
It then uses the [`limit()` function](/v2.0/reference/flux/stdlib/built-in/transformations/limit)
to return the first record from the sorted table.
```js

View File

@ -10,9 +10,9 @@ weight: 301
---
To aggregate your data, use the Flux
[built-in aggregate functions](/v2.0/reference/flux/functions/built-in/transformations/aggregates/)
[built-in aggregate functions](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/)
or create custom aggregate functions using the
[`reduce()`function](/v2.0/reference/flux/functions/built-in/transformations/aggregates/reduce/).
[`reduce()`function](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/reduce/).
## Aggregate function characteristics
Aggregate functions all have the same basic characteristics:
@ -22,7 +22,7 @@ Aggregate functions all have the same basic characteristics:
## How reduce() works
The `reduce()` function operates on one row at a time using the function defined in
the [`fn` parameter](/v2.0/reference/flux/functions/built-in/transformations/aggregates/reduce/#fn).
the [`fn` parameter](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/reduce/#fn).
The `fn` function maps keys to specific values using two [objects](/v2.0/query-data/get-started/syntax-basics/#objects)
specified by the following parameters:
@ -32,7 +32,7 @@ specified by the following parameters:
| `accumulator` | An object that contains values used in each row's aggregate calculation. |
{{% note %}}
The `reduce()` function's [`identity` parameter](/v2.0/reference/flux/functions/built-in/transformations/aggregates/reduce/#identity)
The `reduce()` function's [`identity` parameter](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/reduce/#identity)
defines the initial `accumulator` object.
{{% /note %}}
@ -50,7 +50,7 @@ in an input table.
```
{{% note %}}
To preserve existing columns, [use the `with` operator](/v2.0/reference/flux/functions/built-in/transformations/aggregates/reduce/#preserve-columns)
To preserve existing columns, [use the `with` operator](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/reduce/#preserve-columns)
when mapping values in the `r` object.
{{% /note %}}
@ -150,7 +150,7 @@ and the `reduce()` function to aggregate rows in each input table.
### Create a custom average function
This example illustrates how to create a function that averages values in a table.
_This is meant for demonstration purposes only.
The built-in [`mean()` function](/v2.0/reference/flux/functions/built-in/transformations/aggregates/mean/)
The built-in [`mean()` function](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/mean/)
does the same thing and is much more performant._
{{< code-tabs-wrapper >}}

View File

@ -28,7 +28,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/built-in/transformations/group) defines the
Flux's [`group()` function](/v2.0/reference/flux/stdlib/built-in/transformations/group) defines the
group key for output tables, i.e. grouping records based on values for specific columns.
###### group() example

View File

@ -14,7 +14,7 @@ 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**.
## histogram() function
The [`histogram()` function](/v2.0/reference/flux/functions/built-in/transformations/histogram) approximates the
The [`histogram()` function](/v2.0/reference/flux/stdlib/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.
@ -41,7 +41,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/built-in/misc/linearbins) generates a list of linearly separated floats.
The [`linearBins()` function](/v2.0/reference/flux/stdlib/built-in/misc/linearbins) generates a list of linearly separated floats.
```js
linearBins(start: 0.0, width: 10.0, count: 10)
@ -50,7 +50,7 @@ linearBins(start: 0.0, width: 10.0, count: 10)
```
### logarithmicBins()
The [`logarithmicBins()` function](/v2.0/reference/flux/functions/built-in/misc/logarithmicbins) generates a list of exponentially separated floats.
The [`logarithmicBins()` function](/v2.0/reference/flux/stdlib/built-in/misc/logarithmicbins) generates a list of exponentially separated floats.
```js
logarithmicBins(start: 1.0, factor: 2.0, count: 10, infinity: true)

View File

@ -10,7 +10,7 @@ menu:
weight: 205
---
The [`join()` function](/v2.0/reference/flux/functions/built-in/transformations/join) merges two or more
The [`join()` function](/v2.0/reference/flux/stdlib/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/built-in/transformations/map)
[`map()` function](/v2.0/reference/flux/stdlib/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.

View File

@ -40,7 +40,7 @@ Otherwise, you will get an error similar to:
Error: type error: float != int
```
To convert operands to the same type, use [type-conversion functions](/v2.0/reference/flux/functions/built-in/transformations/type-conversions/)
To convert operands to the same type, use [type-conversion functions](/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/)
or manually format operands.
The operand data type determines the output data type.
For example:
@ -82,7 +82,7 @@ percent(sample: 20.0, total: 80.0)
To transform multiple values in an input stream, your function needs to:
- [Handle piped-forward data](/v2.0/query-data/guides/custom-functions/#functions-that-manipulate-piped-forward-data).
- Use the [`map()` function](/v2.0/reference/flux/functions/built-in/transformations/map) to iterate over each row.
- Use the [`map()` function](/v2.0/reference/flux/stdlib/built-in/transformations/map) to iterate over each row.
The example `multiplyByX()` function below includes:
@ -146,7 +146,7 @@ data
#### Include partial gigabytes
Because the original metric (bytes) is an integer, the output of the operation is an integer and does not include partial GBs.
To calculate partial GBs, convert the `_value` column and its values to floats using the
[`float()` function](/v2.0/reference/flux/functions/built-in/transformations/type-conversions/float)
[`float()` function](/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/float)
and format the denominator in the division operation as a float.
```js

View File

@ -12,7 +12,7 @@ menu:
weight: 206
---
The [`sort()`function](/v2.0/reference/flux/functions/built-in/transformations/sort)
The [`sort()`function](/v2.0/reference/flux/stdlib/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:"example-bucket")
|> sort(columns:["region", "host", "_value"])
```
The [`limit()` function](/v2.0/reference/flux/functions/built-in/transformations/limit)
The [`limit()` function](/v2.0/reference/flux/stdlib/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:"example-bucket")
```
You now have created a Flux query that sorts and limits data.
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)
Flux also provides the [`top()`](/v2.0/reference/flux/stdlib/built-in/transformations/selectors/top)
and [`bottom()`](/v2.0/reference/flux/stdlib/built-in/transformations/selectors/bottom)
functions to perform both of these functions at the same time.

View File

@ -12,7 +12,7 @@ weight: 207
---
The [Flux](/v2.0/reference/flux) `sql` package provides functions for working with SQL data sources.
[`sql.from()`](/v2.0/reference/flux/functions/sql/from/) lets you query SQL data sources
[`sql.from()`](/v2.0/reference/flux/stdlib/sql/from/) lets you query SQL data sources
like [PostgreSQL](https://www.postgresql.org/) and [MySQL](https://www.mysql.com/)
and use the results with InfluxDB dashboards, tasks, and other operations.
@ -59,7 +59,7 @@ sql.from(
{{% /code-tab-content %}}
{{< /code-tabs-wrapper >}}
_See the [`sql.from()` documentation](/v2.0/reference/flux/functions/sql/from/) for
_See the [`sql.from()` documentation](/v2.0/reference/flux/stdlib/sql/from/) for
information about required function parameters._
## Join SQL data with data in InfluxDB

View File

@ -86,7 +86,7 @@ Table: keys: [_start, _stop, _field, _measurement]
{{% /truncate %}}
## Windowing data
Use the [`window()` function](/v2.0/reference/flux/functions/built-in/transformations/window)
Use the [`window()` function](/v2.0/reference/flux/stdlib/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.
@ -170,14 +170,14 @@ When visualized in the InfluxDB UI, each window table is displayed in a differen
![Windowed data](/img/simple-windowed-data.png)
## Aggregate data
[Aggregate functions](/v2.0/reference/flux/functions/built-in/transformations/aggregates) take the values
[Aggregate functions](/v2.0/reference/flux/stdlib/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/built-in/transformations/aggregates/mean)
For this example, use the [`mean()` function](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/mean)
to output the average of each window:
```js
@ -241,7 +241,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/built-in/transformations/duplicate) to
Use the [`duplicate()` function](/v2.0/reference/flux/stdlib/built-in/transformations/duplicate) to
duplicate either the `_start` or `_stop` column as a new `_time` column.
```js
@ -329,7 +329,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/built-in/transformations/aggregates/aggregatewindow)
Flux also provides the [`aggregateWindow()` function](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/aggregatewindow)
which performs all these separate functions for you.
The following Flux query will return the same results:

View File

@ -8,7 +8,7 @@ menu:
name: Annotated CSV
---
Annotated CSV (comma-separated values) format is used to encode HTTP responses and results returned to the Flux [`csv.from()` function](https://v2.docs.influxdata.com/v2.0/reference/flux/functions/csv/from/).
Annotated CSV (comma-separated values) format is used to encode HTTP responses and results returned to the Flux [`csv.from()` function](https://v2.docs.influxdata.com/v2.0/reference/flux/stdlib/csv/from/).
CSV tables must be encoded in UTF-8 and Unicode Normal Form C as defined in [UAX15](http://www.unicode.org/reports/tr15/). Line endings must be CRLF (Carriage Return Line Feed) as defined by the `text/csv` MIME type in [RFC 4180](https://tools.ietf.org/html/rfc4180).

View File

@ -8,7 +8,7 @@ menu:
weight: 4
---
The following articles are meant as a reference for Flux functions and the
Flux language specification.
The following articles are meant as a reference for the Flux standard library and
the Flux language specification.
{{< children >}}

View File

@ -1,15 +0,0 @@
---
title: Flux packages and functions
description: Flux packages and functions allows you to retrieve, transform, process, and output data easily.
v2.0/tags: [flux, functions, package]
menu:
v2_0_ref:
name: Flux packages and functions
parent: Flux query language
weight: 102
---
Flux's functional syntax allows you to retrieve, transform, process, and output data easily.
There is a large library of built-in functions and importable packages:
{{< children >}}

View File

@ -30,7 +30,7 @@ name = "John"
{{% note %}}
#### Flux only interpolates string values
Flux currently interpolates only string values ([IMP#1775](https://github.com/influxdata/flux/issues/1775)).
Use the [string() function](/v2.0/reference/flux/functions/built-in/transformations/type-conversions/string/)
Use the [string() function](/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/string/)
to convert non-string values to strings.
```js

View File

@ -0,0 +1,18 @@
---
title: Flux standard library
description: >
The Flux standard library includes built-in functions and importable packages
that retrieve, transform, process, and output data.
aliases:
- /v2.0/reference/flux/functions/
v2.0/tags: [flux, functions, package]
menu:
v2_0_ref:
parent: Flux query language
weight: 102
---
The Flux standard library includes built-in functions and importable packages
that retrieve, transform,rocess, and output data.
{{< children >}}

View File

@ -1,10 +1,12 @@
---
title: Complete list of Flux functions
description: View the full library of documented Flux functions.
aliases:
- /v2.0/reference/flux/functions/all-functions/
menu:
v2_0_ref:
name: View all functions
parent: Flux packages and functions
parent: Flux standard library
weight: 299
---

View File

@ -4,10 +4,12 @@ list_title: Built-in functions
description: >
Built-in functions provide a foundation for working with data using Flux.
They do not require an import statement and are usable without any extra setup.
aliases:
- /v2.0/reference/flux/functions/built-in/
menu:
v2_0_ref:
name: Built-in
parent: Flux packages and functions
parent: Flux standard library
weight: 201
v2.0/tags: [built-in, functions, package]
---

View File

@ -3,7 +3,8 @@ title: Flux built-in input functions
list_title: 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
- /v2.0/reference/flux/functions/inputs
- /v2.0/reference/flux/functions/built-in/inputs/
menu:
v2_0_ref:
parent: Built-in

View File

@ -3,6 +3,7 @@ title: buckets() function
description: The `buckets()` function returns a list of buckets in the organization.
aliases:
- /v2.0/reference/flux/functions/inputs/buckets
- /v2.0/reference/flux/functions/built-in/inputs/buckets/
menu:
v2_0_ref:
name: buckets

View File

@ -3,6 +3,7 @@ title: from() function
description: The `from()` function retrieves data from an InfluxDB data source.
aliases:
- /v2.0/reference/flux/functions/inputs/from
- /v2.0/reference/flux/functions/built-in/inputs/from/
menu:
v2_0_ref:
name: from

View File

@ -6,6 +6,7 @@ description: >
retrieving, transforming, or outputting data.
aliases:
- /v2.0/reference/flux/functions/misc
- /v2.0/reference/flux/functions/built-in/misc/
menu:
v2_0_ref:
parent: Built-in

View File

@ -3,6 +3,7 @@ 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
- /v2.0/reference/flux/functions/built-in/misc/intervals/
menu:
v2_0_ref:
name: intervals
@ -20,7 +21,7 @@ The set of intervals includes all intervals that intersect with the initial rang
{{% note %}}
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).
of the [`window()` function](/v2.0/reference/flux/stdlib/built-in/transformations/window).
{{% /note %}}
By default the end boundary of an interval will align with the Unix epoch (zero time)

View File

@ -3,6 +3,7 @@ title: linearBins() function
description: The `linearBins()` function generates a list of linearly separated floats.
aliases:
- /v2.0/reference/flux/functions/misc/linearbins
- /v2.0/reference/flux/functions/built-in/misc/linearbins/
menu:
v2_0_ref:
name: linearBins
@ -12,7 +13,7 @@ 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/built-in/transformations/histogram).
[`histogram()` function](/v2.0/reference/flux/stdlib/built-in/transformations/histogram).
_**Function type:** Miscellaneous_
_**Output data type:** Array of floats_

View File

@ -3,6 +3,7 @@ title: logarithmicBins() function
description: The `logarithmicBins()` function generates a list of exponentially separated floats.
aliases:
- /v2.0/reference/flux/functions/misc/logarithmicbins
- /v2.0/reference/flux/functions/built-in/misc/logarithmicbins/
menu:
v2_0_ref:
name: logarithmicBins
@ -12,7 +13,7 @@ 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/built-in/transformations/histogram).
[`histogram()` function](/v2.0/reference/flux/stdlib/built-in/transformations/histogram).
_**Function type:** Miscellaneous_
_**Output data type:** Array of floats_

View File

@ -1,6 +1,8 @@
---
title: now() function
description: The `now()` function returns the current time (UTC).
aliases:
- /v2.0/reference/flux/functions/built-in/misc/now/
menu:
v2_0_ref:
name: now

View File

@ -1,6 +1,8 @@
---
title: sleep() function
description: The `sleep()` function delays execution by a specified duration.
aliases:
- /v2.0/reference/flux/functions/built-in/misc/sleep/
menu:
v2_0_ref:
name: sleep

View File

@ -4,6 +4,7 @@ list_title: 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
- /v2.0/reference/flux/functions/built-in/outputs/
menu:
v2_0_ref:
parent: Built-in

View File

@ -3,6 +3,7 @@ title: to() function
description: The `to()` function writes data to an InfluxDB v2.0 bucket.
aliases:
- /v2.0/reference/flux/functions/outputs/to
- /v2.0/reference/flux/functions/built-in/outputs/to/
menu:
v2_0_ref:
name: to

View File

@ -3,6 +3,7 @@ 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
- /v2.0/reference/flux/functions/built-in/outputs/yield/
menu:
v2_0_ref:
name: yield

View File

@ -2,6 +2,8 @@
title: Flux built-in testing functions
list_title: Built-in testing functions
description: Flux's built-in testing functions test various aspects of piped-forward data.
aliases:
- /v2.0/reference/flux/functions/built-in/tests/
menu:
v2_0_ref:
name: Tests

View File

@ -1,6 +1,8 @@
---
title: contains() function
description: The `contains()` function tests whether a value is a member of a set.
aliases:
- /v2.0/reference/flux/functions/built-in/tests/contains/
menu:
v2_0_ref:
name: contains

View File

@ -4,6 +4,7 @@ list_title: 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
- /v2.0/reference/flux/functions/built-in/transformations/
menu:
v2_0_ref:
parent: Built-in

View File

@ -4,6 +4,7 @@ list_title: 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
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/
menu:
v2_0_ref:
parent: built-in-transformations
@ -29,7 +30,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/built-in/transformations/aggregates/aggregatewindow)
The [`aggregateWindow()` function](/v2.0/reference/flux/stdlib/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.
@ -43,9 +44,9 @@ The following functions are both aggregates and selectors.
Each returns `n` values after performing an aggregate operation.
They are categorized as selector functions in this documentation:
- [highestAverage](/v2.0/reference/flux/functions/transformations/selectors/highestaverage)
- [highestCurrent](/v2.0/reference/flux/functions/transformations/selectors/highestcurrent)
- [highestMax](/v2.0/reference/flux/functions/transformations/selectors/highestmax)
- [lowestAverage](/v2.0/reference/flux/functions/transformations/selectors/lowestaverage)
- [lowestCurrent](/v2.0/reference/flux/functions/transformations/selectors/lowestcurrent)
- [lowestMin](/v2.0/reference/flux/functions/transformations/selectors/lowestmin)
- [highestAverage](/v2.0/reference/flux/stdlib/built-in/transformations/selectors/highestaverage)
- [highestCurrent](/v2.0/reference/flux/stdlib/built-in/transformations/selectors/highestcurrent)
- [highestMax](/v2.0/reference/flux/stdlib/built-in/transformations/selectors/highestmax)
- [lowestAverage](/v2.0/reference/flux/stdlib/built-in/transformations/selectors/lowestaverage)
- [lowestCurrent](/v2.0/reference/flux/stdlib/built-in/transformations/selectors/lowestcurrent)
- [lowestMin](/v2.0/reference/flux/stdlib/built-in/transformations/selectors/lowestmin)

View File

@ -3,6 +3,7 @@ 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
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/aggregatewindow/
menu:
v2_0_ref:
name: aggregateWindow
@ -48,7 +49,7 @@ _**Data type:** Duration_
### fn
The [aggregate function](/v2.0/reference/flux/functions/built-in/transformations/aggregates) used in the operation.
The [aggregate function](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates) used in the operation.
_**Data type:** Function_

View File

@ -3,13 +3,15 @@ title: chandeMomentumOscillator() function
description: >
The `chandeMomentumOscillator()` function applies the technical momentum indicator
developed by Tushar Chande.
aliases:
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/chandemomentumoscillator/
menu:
v2_0_ref:
name: chandeMomentumOscillator
parent: built-in-aggregates
weight: 501
related:
- https://docs.influxdata.com/influxdb/v1.7/query_language/functions/#triple-exponential-moving-average, InfluxQL CHANDE_MOMENTUM_OSCILLATOR()
- https://docs.influxdata.com/influxdb/latest/query_language/functions/#triple-exponential-moving-average, InfluxQL CHANDE_MOMENTUM_OSCILLATOR()
---
The `chandeMomentumOscillator()` function applies the technical momentum indicator

View File

@ -3,6 +3,7 @@ title: count() function
description: The `count()` function outputs the number of non-null records in a column.
aliases:
- /v2.0/reference/flux/functions/transformations/aggregates/count
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/count/
menu:
v2_0_ref:
name: count

View File

@ -3,6 +3,7 @@ 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
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/cov/
menu:
v2_0_ref:
name: cov

View File

@ -3,6 +3,7 @@ title: covariance() function
description: The `covariance()` function computes the covariance between two columns.
aliases:
- /v2.0/reference/flux/functions/transformations/aggregates/covariance
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/covariance/
menu:
v2_0_ref:
name: covariance

View File

@ -3,6 +3,7 @@ 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
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/derivative/
menu:
v2_0_ref:
name: derivative

View File

@ -3,6 +3,7 @@ title: difference() function
description: The `difference()` function computes the difference between subsequent non-null records.
aliases:
- /v2.0/reference/flux/functions/transformations/aggregates/difference
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/difference/
menu:
v2_0_ref:
name: difference

View File

@ -4,22 +4,24 @@ description: >
The `doubleEMA()` function calculates the exponential moving average of values
grouped into `n` number of points, giving more weight to recent data at double
the rate of `exponentialMovingAverage()`.
aliases:
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/doubleema/
menu:
v2_0_ref:
name: doubleEMA
parent: built-in-aggregates
weight: 501
related:
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/movingaverage/
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/tripleema/
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/timedmovingaverage/
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/exponentialmovingaverage/
- https://docs.influxdata.com/influxdb/v1.7/query_language/functions/#double-exponential-moving-average, InfluxQL DOUBLE_EXPONENTIAL_MOVING_AVERAGE()
- /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/movingaverage/
- /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/tripleema/
- /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/timedmovingaverage/
- /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/exponentialmovingaverage/
- https://docs.influxdata.com/influxdb/latest/query_language/functions/#double-exponential-moving-average, InfluxQL DOUBLE_EXPONENTIAL_MOVING_AVERAGE()
---
The `doubleEMA()` function calculates the exponential moving average of values in
the `_value` column grouped into `n` number of points, giving more weight to recent
data at double the rate of [`exponentialMovingAverage()`](/v2.0/reference/flux/functions/built-in/transformations/aggregates/exponentialmovingaverage/).
data at double the rate of [`exponentialMovingAverage()`](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/exponentialmovingaverage/).
_**Function type:** Aggregate_
@ -33,7 +35,7 @@ doubleEMA(n: 5)
- `N = n` is the period used to calculate the EMA.
- A true double exponential moving average requires at least `2 * n - 1` values.
If not enough values exist to calculate the double EMA, it returns a `NaN` value.
- `doubleEMA()` inherits all [exponential moving average rules](/v2.0/reference/flux/functions/built-in/transformations/aggregates/exponentialmovingaverage/#exponential-moving-average-rules).
- `doubleEMA()` inherits all [exponential moving average rules](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/exponentialmovingaverage/#exponential-moving-average-rules).
## Parameters

View File

@ -3,17 +3,19 @@ title: exponentialMovingAverage() function
description: >
The `exponentialMovingAverage()` function calculates the exponential moving average of values
in the `_value` column grouped into `n` number of points, giving more weight to recent data.
aliases:
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/exponentialmovingaverage/
menu:
v2_0_ref:
name: exponentialMovingAverage
parent: built-in-aggregates
weight: 501
related:
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/movingaverage/
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/timedmovingaverage/
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/doubleema/
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/tripleema/
- https://docs.influxdata.com/influxdb/v1.7/query_language/functions/#exponential-moving-average, InfluxQL EXPONENTIAL_MOVING_AVERAGE()
- /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/movingaverage/
- /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/timedmovingaverage/
- /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/doubleema/
- /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/tripleema/
- https://docs.influxdata.com/influxdb/latest/query_language/functions/#exponential-moving-average, InfluxQL EXPONENTIAL_MOVING_AVERAGE()
---
The `exponentialMovingAverage()` function calculates the exponential moving average of values

View File

@ -5,6 +5,7 @@ description: >
that approximates the cumulative distribution of the dataset.
aliases:
- /v2.0/reference/flux/functions/transformations/aggregates/histogramquantile
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/histogramquantile/
menu:
v2_0_ref:
name: histogramQuantile

View File

@ -4,6 +4,7 @@ description: >
The `holtWinters()` function applies the Holt-Winters forecasting method to input tables.
aliases:
- /v2.0/reference/flux/functions/transformations/aggregates/holtwinters
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/holtwinters/
menu:
v2_0_ref:
name: holtWinters
@ -51,10 +52,10 @@ To ensure `holtWinters()` values are spaced evenly in time, the following rules
By default, `holtWinters()` uses the first value in each time bucket to run the Holt-Winters calculation.
To specify other values to use in the calculation, use:
- [`window()`](/v2.0/reference/flux/functions/built-in/transformations/window/)
with [selectors](/v2.0/reference/flux/functions/built-in/transformations/selectors/)
or [aggregates](/v2.0/reference/flux/functions/built-in/transformations/aggregates/)
- [`aggregateWindow()`](/v2.0/reference/flux/functions/built-in/transformations/aggregates/aggregatewindow)
- [`window()`](/v2.0/reference/flux/stdlib/built-in/transformations/window/)
with [selectors](/v2.0/reference/flux/stdlib/built-in/transformations/selectors/)
or [aggregates](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/)
- [`aggregateWindow()`](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/aggregatewindow)
#### Fitted model
The `holtWinters()` function applies the [Nelder-Mead optimization](https://en.wikipedia.org/wiki/Nelder%E2%80%93Mead_method)

View File

@ -3,6 +3,7 @@ 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
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/increase/
menu:
v2_0_ref:
name: increase

View File

@ -3,6 +3,7 @@ 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
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/integral/
menu:
v2_0_ref:
name: integral

View File

@ -3,14 +3,16 @@ title: kaufmansAMA() function
description: >
The `kaufmansAMA()` function calculates the Kaufman's Adaptive Moving Average (KAMA)
using values in an input table.
aliases:
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/kaufmansama/
menu:
v2_0_ref:
name: kaufmansAMA
parent: built-in-aggregates
weight: 501
related:
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/kaufmanser/
- https://docs.influxdata.com/influxdb/v1.7/query_language/functions/#kaufmans-adaptive-moving-average, InfluxQL KAUFMANS_ADAPTIVE_MOVING_AVERAGE()
- /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/kaufmanser/
- https://docs.influxdata.com/influxdb/latest/query_language/functions/#kaufmans-adaptive-moving-average, InfluxQL KAUFMANS_ADAPTIVE_MOVING_AVERAGE()
---
The `kaufmansAMA()` function calculates the Kaufman's Adaptive Moving Average (KAMA)

View File

@ -3,14 +3,16 @@ title: kaufmansER() function
description: >
The `kaufmansER()` function calculates the Kaufman's Efficiency Ratio (KER) using
values in an input table.
aliases:
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/kaufmanser/
menu:
v2_0_ref:
name: kaufmansER
parent: built-in-aggregates
weight: 501
related:
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/kaufmansama/
- https://docs.influxdata.com/influxdb/v1.7/query_language/functions/#kaufmans-efficiency-ratio, InfluxQL KAUFMANS_EFFICIENCY_RATIO()
- /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/kaufmansama/
- https://docs.influxdata.com/influxdb/latest/query_language/functions/#kaufmans-efficiency-ratio, InfluxQL KAUFMANS_EFFICIENCY_RATIO()
---
The `kaufmansER()` function calculates the Kaufman's Efficiency Ratio (KER) using

View File

@ -3,6 +3,7 @@ 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
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/mean/
menu:
v2_0_ref:
name: mean

View File

@ -5,6 +5,7 @@ description: >
in the input table with values that fall within the `0.5` quantile or 50th percentile.
aliases:
- /v2.0/reference/flux/functions/transformations/aggregates/median
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/median/
menu:
v2_0_ref:
name: median
@ -12,7 +13,7 @@ menu:
weight: 501
---
The `median()` function is a special application of the [`quantile()` function](/v2.0/reference/flux/functions/built-in/transformations/aggregates/quantile)
The `median()` function is a special application of the [`quantile()` function](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/quantile)
that returns the median `_value` of an input table or all non-null records in the input table
with values that fall within the `0.5` quantile (50th percentile) depending on the [method](#method) used.
@ -36,9 +37,9 @@ value that represents the `0.5` quantile.
{{% note %}}
The `median()` function can only be used with float value types.
It is a special application of the [`quantile()` function](/v2.0/reference/flux/functions/built-in/transformations/aggregates/quantile)
It is a special application of the [`quantile()` function](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/quantile)
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/built-in/transformations/type-conversions/tofloat).
You can convert your value column to a float column using the [`toFloat()` function](/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/tofloat).
{{% /note %}}
## Parameters

View File

@ -3,6 +3,8 @@ title: mode() function
description: >
The `mode()` function computes the mode or value that occurs most often in a
specified column in the input table.
aliases:
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/mode/
menu:
v2_0_ref:
name: mode
@ -57,4 +59,4 @@ from(bucket: "example-bucket")
<hr style="margin-top:4rem"/>
##### Related InfluxQL functions and statements:
[MODE()](https://docs.influxdata.com/influxdb/latest/query_language/functions/#mode)
[MODE()](https://docs.influxdata.com/influxdb/latest/query_language/functions/#mode)

View File

@ -2,16 +2,18 @@
title: movingAverage() function
description: >
The `movingAverage()` function calculates the mean of values grouped into `n` number of points.
aliases:
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/movingaverage/
menu:
v2_0_ref:
name: movingAverage
parent: built-in-aggregates
weight: 501
related:
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/timedmovingaverage/
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/exponentialmovingaverage/
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/doubleema/
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/tripleema/
- /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/timedmovingaverage/
- /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/exponentialmovingaverage/
- /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/doubleema/
- /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/tripleema/
- https://docs.influxdata.com/influxdb/latest/query_language/functions/#moving-average, InfluxQL MOVING_AVERAGE()
---

View File

@ -3,6 +3,7 @@ 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
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/pearsonr/
menu:
v2_0_ref:
name: pearsonr

View File

@ -4,6 +4,7 @@ description: The `quantile()` function outputs non-null records with values that
aliases:
- /v2.0/reference/flux/functions/transformations/aggregates/percentile
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/percentile
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/quantile/
menu:
v2_0_ref:
name: quantile

View File

@ -3,6 +3,8 @@ title: reduce() function
description: >
The `reduce()` function aggregates records in each table according to the reducer,
`fn`, providing a way to create custom table aggregations.
aliases:
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/reduce/
menu:
v2_0_ref:
name: reduce

View File

@ -3,16 +3,18 @@ title: relativeStrengthIndex() function
description: >
The `relativeStrengthIndex()` function measures the relative speed and change of
values in an input table.
aliases:
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/relativestrengthindex/
menu:
v2_0_ref:
name: relativeStrengthIndex
parent: built-in-aggregates
weight: 501
related:
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/movingaverage/
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/timedmovingaverage/
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/exponentialmovingaverage/
- https://docs.influxdata.com/influxdb/v1.7/query_language/functions/#relative-strength-index, InfluxQL RELATIVE_STRENGTH_INDEX()
- /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/movingaverage/
- /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/timedmovingaverage/
- /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/exponentialmovingaverage/
- https://docs.influxdata.com/influxdb/latest/query_language/functions/#relative-strength-index, InfluxQL RELATIVE_STRENGTH_INDEX()
---
The `relativeStrengthIndex()` function measures the relative speed and change of

View File

@ -3,6 +3,7 @@ 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
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/skew/
menu:
v2_0_ref:
name: skew

View File

@ -3,6 +3,7 @@ title: spread() function
description: The `spread()` function outputs the difference between the minimum and maximum values in a specified column.
aliases:
- /v2.0/reference/flux/functions/transformations/aggregates/spread
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/spread/
menu:
v2_0_ref:
name: spread

View File

@ -3,6 +3,7 @@ title: stddev() function
description: The `stddev()` function computes the standard deviation of non-null records in a specified column.
aliases:
- /v2.0/reference/flux/functions/transformations/aggregates/stddev
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/stddev/
menu:
v2_0_ref:
name: stddev

View File

@ -3,6 +3,7 @@ title: sum() function
description: The `sum()` function computes the sum of non-null records in a specified column.
aliases:
- /v2.0/reference/flux/functions/transformations/aggregates/sum
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/sum/
menu:
v2_0_ref:
name: sum
@ -41,4 +42,4 @@ from(bucket: "example-bucket")
<hr style="margin-top:4rem"/>
##### Related InfluxQL functions and statements:
[SUM()](https://docs.influxdata.com/influxdb/latest/query_language/functions/#sum)
[SUM()](https://docs.influxdata.com/influxdb/latest/query_language/functions/#sum)

View File

@ -3,16 +3,18 @@ title: timedMovingAverage() function
description: >
The `timedMovingAverage()` function calculates the mean of values in a defined time
range at a specified frequency.
aliases:
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/timedmovingaverage/
menu:
v2_0_ref:
name: timedMovingAverage
parent: built-in-aggregates
weight: 501
related:
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/movingaverage/
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/exponentialmovingaverage/
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/doubleema/
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/tripleema/
- /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/movingaverage/
- /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/exponentialmovingaverage/
- /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/doubleema/
- /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/tripleema/
- https://docs.influxdata.com/influxdb/latest/query_language/functions/#moving-average, InfluxQL MOVING_AVERAGE()
---

View File

@ -4,24 +4,26 @@ description: >
The `tripleEMA()` function calculates the exponential moving average of values
grouped into `n` number of points, giving more weight to recent data with less lag
than `exponentialMovingAverage()` and `doubleEMA()`.
aliases:
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/tripleema/
menu:
v2_0_ref:
name: tripleEMA
parent: built-in-aggregates
weight: 501
related:
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/movingaverage/
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/doubleema/
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/timedmovingaverage/
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/exponentialmovingaverage/
- https://docs.influxdata.com/influxdb/v1.7/query_language/functions/#triple-exponential-moving-average, InfluxQL TRIPLE_EXPONENTIAL_MOVING_AVERAGE()
- /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/movingaverage/
- /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/doubleema/
- /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/timedmovingaverage/
- /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/exponentialmovingaverage/
- https://docs.influxdata.com/influxdb/latest/query_language/functions/#triple-exponential-moving-average, InfluxQL TRIPLE_EXPONENTIAL_MOVING_AVERAGE()
---
The `tripleEMA()` function calculates the exponential moving average of values in
the `_value` column grouped into `n` number of points, giving more weight to recent
data with less lag than
[`exponentialMovingAverage()`](/v2.0/reference/flux/functions/built-in/transformations/aggregates/exponentialmovingaverage/)
and [`doubleEMA()`](/v2.0/reference/flux/functions/built-in/transformations/aggregates/doubleema/).
[`exponentialMovingAverage()`](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/exponentialmovingaverage/)
and [`doubleEMA()`](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/doubleema/).
_**Function type:** Aggregate_
@ -36,7 +38,7 @@ tripleEMA(n: 5)
- `EMA_3` is the exponential moving average of `EMA_2`.
- A true triple exponential moving average requires at least requires at least `3 * n - 2` values.
If not enough values exist to calculate the triple EMA, it returns a `NaN` value.
- `tripleEMA()` inherits all [exponential moving average rules](/v2.0/reference/flux/functions/built-in/transformations/aggregates/exponentialmovingaverage/#exponential-moving-average-rules).
- `tripleEMA()` inherits all [exponential moving average rules](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/exponentialmovingaverage/#exponential-moving-average-rules).
## Parameters

View File

@ -3,6 +3,8 @@ title: tripleExponentialDerivative() function
description: >
The `tripleExponentialDerivative()` function calculates a triple exponential
derivative (TRIX) of input tables using `n` points.
aliases:
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/tripleexponentialderivative/
menu:
v2_0_ref:
name: tripleExponentialDerivative
@ -10,12 +12,12 @@ menu:
weight: 501
v2.0/tags: [technical analysis]
related:
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/movingaverage/
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/doubleema/
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/tripleema/
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/timedmovingaverage/
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/exponentialmovingaverage/
- https://docs.influxdata.com/influxdb/v1.7/query_language/functions/#triple-exponential-derivative, InfluxQL TRIPLE_EXPONENTIAL_DERIVATIVE()
- /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/movingaverage/
- /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/doubleema/
- /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/tripleema/
- /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/timedmovingaverage/
- /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/exponentialmovingaverage/
- https://docs.influxdata.com/influxdb/latest/query_language/functions/#triple-exponential-derivative, InfluxQL TRIPLE_EXPONENTIAL_DERIVATIVE()
---
The `tripleExponentialDerivative()` function calculates a triple exponential
@ -46,7 +48,7 @@ a negative value indicates decreasing momentum.
- `EMA_3 = EMA(EMA(EMA(data)))`
- If there are not enough values to calculate a triple exponential derivative,
the output `_value` is `NaN`; all other columns are the same as the _last_ record of the input table.
- The function behaves the same way as the [`exponentialMovingAverage()`](/v2.0/reference/flux/functions/built-in/transformations/aggregates/exponentialmovingaverage/) function:
- The function behaves the same way as the [`exponentialMovingAverage()`](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/exponentialmovingaverage/) function:
- The function does not include `null` values in the calculation.
- The function acts only on the `_value` column.

View File

@ -6,6 +6,7 @@ description: >
plus a new column containing the labels of the input table's columns.
aliases:
- /v2.0/reference/flux/functions/transformations/columns
- /v2.0/reference/flux/functions/built-in/transformations/columns/
menu:
v2_0_ref:
name: columns

View File

@ -3,6 +3,7 @@ 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
- /v2.0/reference/flux/functions/built-in/transformations/cumulativesum/
menu:
v2_0_ref:
name: cumulativeSum

View File

@ -3,6 +3,7 @@ title: drop() function
description: The `drop()` function removes specified columns from a table.
aliases:
- /v2.0/reference/flux/functions/transformations/drop
- /v2.0/reference/flux/functions/built-in/transformations/drop/
menu:
v2_0_ref:
name: drop

View File

@ -3,6 +3,7 @@ title: duplicate() function
description: The `duplicate()` function duplicates a specified column in a table.
aliases:
- /v2.0/reference/flux/functions/transformations/duplicate
- /v2.0/reference/flux/functions/built-in/transformations/duplicate/
menu:
v2_0_ref:
name: duplicate

View File

@ -1,6 +1,8 @@
---
title: elapsed() function
description: The `elapsed()` function returns the time between subsequent records.
aliases:
- /v2.0/reference/flux/functions/built-in/transformations/elapsed/
menu:
v2_0_ref:
name: elapsed

View File

@ -3,6 +3,7 @@ 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
- /v2.0/reference/flux/functions/built-in/transformations/fill/
menu:
v2_0_ref:
name: fill

View File

@ -3,6 +3,7 @@ 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
- /v2.0/reference/flux/functions/built-in/transformations/filter/
menu:
v2_0_ref:
name: filter

View File

@ -3,6 +3,7 @@ title: group() function
description: The `group()` function groups records based on their values for specific columns.
aliases:
- /v2.0/reference/flux/functions/transformations/group
- /v2.0/reference/flux/functions/built-in/transformations/group/
menu:
v2_0_ref:
name: group

View File

@ -3,6 +3,7 @@ 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
- /v2.0/reference/flux/functions/built-in/transformations/histogram/
menu:
v2_0_ref:
name: histogram
@ -56,8 +57,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/built-in/misc/linearbins)
[logarithmicBins()](/v2.0/reference/flux/functions/built-in/misc/logarithmicbins)
[linearBins()](/v2.0/reference/flux/stdlib/built-in/misc/linearbins)
[logarithmicBins()](/v2.0/reference/flux/stdlib/built-in/misc/logarithmicbins)
### normalize
When `true`, will convert the counts into frequency values between 0 and 1.

View File

@ -4,7 +4,8 @@ description: >
The `hourSelection()` function retains all rows with time values in a specified hour range.
Hours are specified in military time.
aliases:
- /v2.0/reference/flux/functions/transformations/hourSelection
- /v2.0/reference/flux/functions/transformations/hourselection
- /v2.0/reference/flux/functions/built-in/transformations/hourselection/
menu:
v2_0_ref:
name: hourSelection

View File

@ -3,6 +3,7 @@ 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
- /v2.0/reference/flux/functions/built-in/transformations/join/
menu:
v2_0_ref:
name: join

View File

@ -3,6 +3,7 @@ title: keep() function
description: The `keep()` function returns a table containing only the specified columns.
aliases:
- /v2.0/reference/flux/functions/transformations/keep
- /v2.0/reference/flux/functions/built-in/transformations/keep/
menu:
v2_0_ref:
name: keep
@ -12,7 +13,7 @@ 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/built-in/transformations/drop)._
_It is the inverse of [`drop`](/v2.0/reference/flux/stdlib/built-in/transformations/drop)._
_**Function type:** Transformation_
_**Output data type:** Object_

View File

@ -6,6 +6,7 @@ description: >
_value column containing the labels of the input table's group key.
aliases:
- /v2.0/reference/flux/functions/transformations/keys
- /v2.0/reference/flux/functions/built-in/transformations/keys/
menu:
v2_0_ref:
name: keys

View File

@ -3,6 +3,7 @@ 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
- /v2.0/reference/flux/functions/built-in/transformations/keyvalues/
menu:
v2_0_ref:
name: keyValues

View File

@ -3,13 +3,14 @@ title: limit() function
description: The `limit()` function limits each output table to the first `n` records.
aliases:
- /v2.0/reference/flux/functions/transformations/limit
- /v2.0/reference/flux/functions/built-in/transformations/limit/
menu:
v2_0_ref:
name: limit
parent: built-in-transformations
weight: 401
related:
- /v2.0/reference/flux/functions/built-in/transformations/tail/
- /v2.0/reference/flux/stdlib/built-in/transformations/tail/
- https://docs.influxdata.com/influxdb/latest/query_language/data_exploration/#the-limit-and-slimit-clauses, InfluxQL LIMIT
---

View File

@ -3,6 +3,7 @@ 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
- /v2.0/reference/flux/functions/built-in/transformations/map/
menu:
v2_0_ref:
name: map

View File

@ -3,6 +3,7 @@ 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
- /v2.0/reference/flux/functions/built-in/transformations/pivot/
menu:
v2_0_ref:
name: pivot

View File

@ -3,6 +3,7 @@ title: range() function
description: The `range()` function filters records based on time bounds.
aliases:
- /v2.0/reference/flux/functions/transformations/range
- /v2.0/reference/flux/functions/built-in/transformations/range/
menu:
v2_0_ref:
name: range

View File

@ -3,6 +3,7 @@ title: rename() function
description: The `rename()` function renames specified columns in a table.
aliases:
- /v2.0/reference/flux/functions/transformations/rename
- /v2.0/reference/flux/functions/built-in/transformations/rename/
menu:
v2_0_ref:
name: rename

View File

@ -4,6 +4,7 @@ list_title: 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
- /v2.0/reference/flux/functions/built-in/transformations/selectors/
menu:
v2_0_ref:
parent: built-in-transformations
@ -25,5 +26,5 @@ The following selector functions are available:
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)
- [quantile](/v2.0/reference/flux/functions/built-in/transformations/aggregates/quantile)
- [median](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/median)
- [quantile](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/quantile)

View File

@ -3,6 +3,7 @@ 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
- /v2.0/reference/flux/functions/built-in/transformations/selectors/bottom/
menu:
v2_0_ref:
name: bottom

View File

@ -3,6 +3,7 @@ title: distinct() function
description: The `distinct()` function returns the unique values for a given column.
aliases:
- /v2.0/reference/flux/functions/transformations/selectors/distinct
- /v2.0/reference/flux/functions/built-in/transformations/selectors/distinct/
menu:
v2_0_ref:
name: distinct

View File

@ -3,6 +3,7 @@ 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
- /v2.0/reference/flux/functions/built-in/transformations/selectors/first/
menu:
v2_0_ref:
name: first

View File

@ -3,6 +3,7 @@ title: highestAverage() function
description: The `highestAverage()` function calculates the average of each table in the input stream returns the top `n` records.
aliases:
- /v2.0/reference/flux/functions/transformations/selectors/highestaverage
- /v2.0/reference/flux/functions/built-in/transformations/selectors/highestaverage/
menu:
v2_0_ref:
name: highestAverage

View File

@ -3,6 +3,7 @@ title: highestCurrent() function
description: The `highestCurrent()` function selects the last record of each table in the input stream and returns the top `n` records.
aliases:
- /v2.0/reference/flux/functions/transformations/selectors/highestcurrent
- /v2.0/reference/flux/functions/built-in/transformations/selectors/highestcurrent/
menu:
v2_0_ref:
name: highestCurrent

View File

@ -3,6 +3,7 @@ title: highestMax() function
description: The `highestMax()` function selects the maximum record from each table in the input stream and returns the top `n` records.
aliases:
- /v2.0/reference/flux/functions/transformations/selectors/highestmax
- /v2.0/reference/flux/functions/built-in/transformations/selectors/highestmax/
menu:
v2_0_ref:
name: highestMax

View File

@ -3,6 +3,7 @@ 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
- /v2.0/reference/flux/functions/built-in/transformations/selectors/last/
menu:
v2_0_ref:
name: last

View File

@ -3,6 +3,7 @@ title: lowestAverage() function
description: The `lowestAverage()` function calculates the average of each table in the input stream returns the lowest `n` records.
aliases:
- /v2.0/reference/flux/functions/transformations/selectors/lowestaverage
- /v2.0/reference/flux/functions/built-in/transformations/selectors/lowestaverage/
menu:
v2_0_ref:
name: lowestAverage

View File

@ -3,6 +3,7 @@ title: lowestCurrent() function
description: The `lowestCurrent()` function selects the last record of each table in the input stream and returns the lowest `n` records.
aliases:
- /v2.0/reference/flux/functions/transformations/selectors/lowestcurrent
- /v2.0/reference/flux/functions/built-in/transformations/selectors/lowestcurrent/
menu:
v2_0_ref:
name: lowestCurrent

View File

@ -3,6 +3,7 @@ title: lowestMin() function
description: The `lowestMin()` function selects the minimum record from each table in the input stream and returns the lowest `n` records.
aliases:
- /v2.0/reference/flux/functions/transformations/selectors/lowestmin
- /v2.0/reference/flux/functions/built-in/transformations/selectors/lowestmin/
menu:
v2_0_ref:
name: lowestMin

Some files were not shown because too many files have changed in this diff Show More