From a0c6ddc7c142914f3618cc02f29f39c15529d991 Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Thu, 2 Apr 2020 13:25:00 -0600 Subject: [PATCH 01/23] WIP adding list code examples to flux query guides --- content/v2.0/query-data/flux/group-data.md | 15 ++++++++---- content/v2.0/query-data/flux/histograms.md | 21 ++++++++++++---- .../query-data/flux/mathematic-operations.md | 11 +++++++-- content/v2.0/query-data/flux/query-fields.md | 12 +++++++++- content/v2.0/query-data/flux/sort-limit.md | 24 +++++++++++++------ .../v2.0/query-data/flux/window-aggregate.md | 11 ++++++--- 6 files changed, 72 insertions(+), 22 deletions(-) diff --git a/content/v2.0/query-data/flux/group-data.md b/content/v2.0/query-data/flux/group-data.md index 8c06aa314..ab9ed1c5e 100644 --- a/content/v2.0/query-data/flux/group-data.md +++ b/content/v2.0/query-data/flux/group-data.md @@ -1,17 +1,22 @@ --- title: Group data in InfluxDB with Flux -list_title: Group data +list_title: Group description: > - This guide walks through grouping data with Flux by providing examples and - illustrating how data is shaped throughout the process. + Use the [`group()` function](/v2.0/reference/flux/stdlib/built-in/transformations/group) + to group data with common values in specific columns. v2.0/tags: [group] menu: v2_0: - name: Group data + name: Group parent: Query with Flux weight: 202 aliases: - - /v2.0/query-data/guides/group-data/ + - /v2.0/query-data/guides/group-data/ +list_code_example: | + ```js + data + |> group(columns: ["cpu", "host"], mode: "by") + ``` --- With Flux, you can group data by any column in your queried data set. diff --git a/content/v2.0/query-data/flux/histograms.md b/content/v2.0/query-data/flux/histograms.md index ab4e3337a..713ab0858 100644 --- a/content/v2.0/query-data/flux/histograms.md +++ b/content/v2.0/query-data/flux/histograms.md @@ -1,15 +1,28 @@ --- title: Create histograms with Flux -list_title: Create histograms -description: This guide walks through using the `histogram()` function to create cumulative histograms with Flux. +list_title: Histograms +description: > + Use the [`histogram()` function](/v2.0/reference/flux/stdlib/built-in/transformations/histogram/) + to create cumulative histograms with Flux. v2.0/tags: [histogram] menu: v2_0: - name: Create histograms + name: Histograms parent: Query with Flux weight: 210 aliases: - - /v2.0/query-data/guides/histograms/ + - /v2.0/query-data/guides/histograms/ +list_code_example: | + ```js + data + |> histogram( + column: "_value", + upperBoundColumn: "le", + countColumn: "_value", + bins: [50.0, 75.0, 90.0], + normalize: false) + ) + ``` --- Histograms provide valuable insight into the distribution of your data. diff --git a/content/v2.0/query-data/flux/mathematic-operations.md b/content/v2.0/query-data/flux/mathematic-operations.md index bdb115670..dc3647e27 100644 --- a/content/v2.0/query-data/flux/mathematic-operations.md +++ b/content/v2.0/query-data/flux/mathematic-operations.md @@ -2,7 +2,9 @@ title: Transform data with mathematic operations seotitle: Transform data with mathematic operations in Flux list_title: Transform data with math -description: This guide describes how to use Flux to transform data with mathematic operations. +description: > + Use the [`map()` function](/v2.0/reference/flux/stdlib/built-in/transformations/map) + to remap column values and apply mathematic operations. v2.0/tags: [math, flux] menu: v2_0: @@ -10,7 +12,12 @@ menu: parent: Query with Flux weight: 205 aliases: - - /v2.0/query-data/guides/mathematic-operations/ + - /v2.0/query-data/guides/mathematic-operations/ +list_code_example: | + ```js + data + |> map(fn: (r) => ({ r with _value: r._value * r._value })) + ``` --- [Flux](/v2.0/reference/flux), InfluxData's data scripting and query language, diff --git a/content/v2.0/query-data/flux/query-fields.md b/content/v2.0/query-data/flux/query-fields.md index ae480e9a2..c48ba5561 100644 --- a/content/v2.0/query-data/flux/query-fields.md +++ b/content/v2.0/query-data/flux/query-fields.md @@ -2,7 +2,7 @@ title: Query fields and tags seotitle: Query fields and tags in InfluxDB using Flux description: > - Use the `filter()` function to query data based on fields, tags, or any other column value. + Use the [`filter()` function](/v2.0/reference/flux/stdlib/built-in/transformations/filter/) to query data based on fields, tags, or any other column value. `filter()` performs operations similar to the `SELECT` statement and the `WHERE` clause in InfluxQL and other SQL-like query languages. weight: 201 @@ -10,6 +10,16 @@ menu: v2_0: parent: Query with Flux v2.0/tags: [query, select, where] +list_code_example: | + ```js + from(bucket: "example-bucket") + |> range(start: -1h) + |> filter(fn: (r) => + r._measurement == "example-measurement" and + r._field == "example-field" and + r.tag == "example-tag" + ) + ``` --- Use the [`filter()` function](/v2.0/reference/flux/stdlib/built-in/transformations/filter/) diff --git a/content/v2.0/query-data/flux/sort-limit.md b/content/v2.0/query-data/flux/sort-limit.md index 072f424f4..e98455d52 100644 --- a/content/v2.0/query-data/flux/sort-limit.md +++ b/content/v2.0/query-data/flux/sort-limit.md @@ -1,22 +1,32 @@ --- title: Sort and limit data with Flux seotitle: Sort and limit data in InfluxDB with Flux -list_title: Sort and limit data +list_title: Sort and limit description: > - This guide walks through sorting and limiting data with Flux and outlines how - it shapes your data in the process. + Use the [`sort()`function](/v2.0/reference/flux/stdlib/built-in/transformations/sort) + to order records within each table by specific columns and the + [`limit()` function](/v2.0/reference/flux/stdlib/built-in/transformations/limit) + to limit the number of records in output tables to a fixed number, `n`. v2.0/tags: [sort, limit] menu: v2_0: - name: Sort and limit data + name: Sort and limit parent: Query with Flux weight: 203 aliases: - - /v2.0/query-data/guides/sort-limit/ + - /v2.0/query-data/guides/sort-limit/ +list_code_example: | + ```js + data + |> sort(columns: ["host", "_value"]) + |> limit(n: 10) + ``` --- -The [`sort()`function](/v2.0/reference/flux/stdlib/built-in/transformations/sort) -orders the records within each table. +Use the [`sort()`function](/v2.0/reference/flux/stdlib/built-in/transformations/sort) +to order records within each table by specific columns and the +[`limit()` function](/v2.0/reference/flux/stdlib/built-in/transformations/limit) +to limit the number of records in output tables to a fixed number, `n`. If you're just getting started with Flux queries, check out the following: diff --git a/content/v2.0/query-data/flux/window-aggregate.md b/content/v2.0/query-data/flux/window-aggregate.md index 4f14aacae..9eec46972 100644 --- a/content/v2.0/query-data/flux/window-aggregate.md +++ b/content/v2.0/query-data/flux/window-aggregate.md @@ -1,18 +1,23 @@ --- title: Window and aggregate data with Flux seotitle: Window and aggregate data in InfluxDB with Flux -list_title: Window & aggregate data +list_title: Window & aggregate description: > This guide walks through windowing and aggregating data with Flux and outlines how it shapes your data in the process. menu: v2_0: - name: Window & aggregate data + name: Window & aggregate parent: Query with Flux weight: 204 v2.0/tags: [flux, aggregates] aliases: - - /v2.0/query-data/guides/window-aggregate/ + - /v2.0/query-data/guides/window-aggregate/ +list_code_example: | + ```js + data + |> aggregateWindow(every: 5m, fn: mean) + ``` --- A common operation performed with time series data is grouping data into windows of time, From 92c4258d3f172e10bbad69d7674a052b62adf89c Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Fri, 3 Apr 2020 17:04:47 -0600 Subject: [PATCH 02/23] finished adding code examples of common flux queries --- content/v2.0/query-data/flux/conditional-logic.md | 10 +++++++--- content/v2.0/query-data/flux/cumulativesum.md | 7 ++++++- .../query-data/flux/custom-functions/_index.md | 14 ++++++++++++-- content/v2.0/query-data/flux/exists.md | 11 +++++++++-- content/v2.0/query-data/flux/geo/_index.md | 9 +++++++++ content/v2.0/query-data/flux/join.md | 13 ++++++++++--- content/v2.0/query-data/flux/median.md | 7 ++++++- .../v2.0/query-data/flux/percentile-quantile.md | 7 ++++++- .../v2.0/query-data/flux/regular-expressions.md | 11 ++++++++--- content/v2.0/query-data/flux/scalar-values.md | 10 ++++++++++ content/v2.0/query-data/flux/sql.md | 12 ++++++++++++ 11 files changed, 95 insertions(+), 16 deletions(-) diff --git a/content/v2.0/query-data/flux/conditional-logic.md b/content/v2.0/query-data/flux/conditional-logic.md index c97ea9b7b..a240b1a62 100644 --- a/content/v2.0/query-data/flux/conditional-logic.md +++ b/content/v2.0/query-data/flux/conditional-logic.md @@ -1,18 +1,22 @@ --- title: Query using conditional logic seotitle: Query using conditional logic in Flux -list_title: Use conditional logic +list_title: Conditional logic description: > This guide describes how to use Flux conditional expressions, such as `if`, `else`, and `then`, to query and transform data. v2.0/tags: [conditionals, flux] menu: v2_0: - name: Use conditional logic + name: Conditional logic parent: Query with Flux weight: 220 aliases: - - /v2.0/query-data/guides/conditional-logic/ + - /v2.0/query-data/guides/conditional-logic/ +list_code_example: | + ```js + if color == "green" then "008000" else "ffffff" + ``` --- Flux provides `if`, `then`, and `else` conditional expressions that allow for powerful and flexible Flux queries. diff --git a/content/v2.0/query-data/flux/cumulativesum.md b/content/v2.0/query-data/flux/cumulativesum.md index ff9c26705..52e1d56de 100644 --- a/content/v2.0/query-data/flux/cumulativesum.md +++ b/content/v2.0/query-data/flux/cumulativesum.md @@ -8,8 +8,13 @@ weight: 210 menu: v2_0: parent: Query with Flux - name: Query the cumulative sum + name: Cumulative sum v2.0/tags: [query, cumulative sum] +list_code_example: | + ```js + data + |> cumulativeSum() + ``` --- Use the [`cumulativeSum()` function](/v2.0/reference/flux/stdlib/built-in/transformations/cumulativesum/) diff --git a/content/v2.0/query-data/flux/custom-functions/_index.md b/content/v2.0/query-data/flux/custom-functions/_index.md index 1c1c2c99d..d65e0837f 100644 --- a/content/v2.0/query-data/flux/custom-functions/_index.md +++ b/content/v2.0/query-data/flux/custom-functions/_index.md @@ -1,14 +1,24 @@ --- title: Create custom Flux functions description: Create your own custom Flux functions to transform and manipulate data. +list_title: Custom functions v2.0/tags: [functions, custom, flux] menu: v2_0: - name: Create custom functions + name: Custom functions parent: Query with Flux weight: 220 aliases: - - /v2.0/query-data/guides/custom-functions/ + - /v2.0/query-data/guides/custom-functions/ +list_code_example: | + ```js + multByX = (tables=<-, x) => + tables + |> map(fn: (r) => ({ r with _value: r._value * x})) + + data + |> multByX(x: 2.0) + ``` --- Flux's functional syntax allows for custom functions. diff --git a/content/v2.0/query-data/flux/exists.md b/content/v2.0/query-data/flux/exists.md index 3885e0e93..ee2e656a9 100644 --- a/content/v2.0/query-data/flux/exists.md +++ b/content/v2.0/query-data/flux/exists.md @@ -1,17 +1,24 @@ --- title: Check if a value exists seotitle: Use Flux to check if a value exists +list_title: Exists description: > Use the Flux `exists` operator to check if an object contains a key or if that key's value is `null`. v2.0/tags: [exists] menu: v2_0: - name: Check if a value exists + name: Exists parent: Query with Flux weight: 220 aliases: - /v2.0/query-data/guides/exists/ +list_code_example: | + ##### Filter null values + ```js + data + |> filter(fn: (r) => exists r._value) + ``` --- Use the Flux `exists` operator to check if an object contains a key or if that @@ -38,7 +45,7 @@ Use `exists` with row functions ( [`reduce()`](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/reduce/)) to check if a row includes a column or if the value for that column is `null`. -#### Filter out null values +#### Filter null values ```js from(bucket: "example-bucket") |> range(start: -5m) diff --git a/content/v2.0/query-data/flux/geo/_index.md b/content/v2.0/query-data/flux/geo/_index.md index 3cc45fae4..9ac2c59ba 100644 --- a/content/v2.0/query-data/flux/geo/_index.md +++ b/content/v2.0/query-data/flux/geo/_index.md @@ -1,5 +1,6 @@ --- title: Work with geo-temporal data +list_title: Geo-temporal data description: > Use the Flux Geo package to filter geo-temporal data and group by geographic location or track. menu: @@ -7,6 +8,14 @@ menu: name: Geo-temporal data parent: Query with Flux weight: 220 +list_code_example: | + ```js + import "experimental/geo" + + sampleGeoData + |> geo.filterRows(region: {lat: 30.04, lon: 31.23, radius: 200.0}) + |> geo.groupByArea(newColumn: "geoArea", level: 5) + ``` --- Use the [Flux Geo package](/v2.0/reference/flux/stdlib/experimental/geo) to diff --git a/content/v2.0/query-data/flux/join.md b/content/v2.0/query-data/flux/join.md index 592437959..4ea34d38c 100644 --- a/content/v2.0/query-data/flux/join.md +++ b/content/v2.0/query-data/flux/join.md @@ -1,16 +1,23 @@ --- title: Join data with Flux seotitle: Join data in InfluxDB with Flux -list_title: Join data +list_title: Join description: This guide walks through joining data with Flux and outlines how it shapes your data in the process. v2.0/tags: [join, flux] menu: v2_0: - name: Join data + name: Join parent: Query with Flux weight: 220 aliases: - - /v2.0/query-data/guides/join/ + - /v2.0/query-data/guides/join/ +list_code_example: | + ```js + join( + tables: {t1: stream1, t2: stream2}, + on: ["_time"] + ) + ``` --- The [`join()` function](/v2.0/reference/flux/stdlib/built-in/transformations/join) merges two or more diff --git a/content/v2.0/query-data/flux/median.md b/content/v2.0/query-data/flux/median.md index 855e2e8da..e3a9cae06 100644 --- a/content/v2.0/query-data/flux/median.md +++ b/content/v2.0/query-data/flux/median.md @@ -9,10 +9,15 @@ weight: 210 menu: v2_0: parent: Query with Flux - name: Find the median + name: Median v2.0/tags: [query, median] related: - /v2.0/query-data/flux/percentile-quantile/ +list_code_example: | + ```js + data + |> median() + ``` --- Use the [`median()` function](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/median/) diff --git a/content/v2.0/query-data/flux/percentile-quantile.md b/content/v2.0/query-data/flux/percentile-quantile.md index 5e221989d..8f8600fba 100644 --- a/content/v2.0/query-data/flux/percentile-quantile.md +++ b/content/v2.0/query-data/flux/percentile-quantile.md @@ -9,10 +9,15 @@ weight: 210 menu: v2_0: parent: Query with Flux - name: Query percentiles & quantiles + name: Percentile & quantile v2.0/tags: [query, percentile, quantile] related: - /v2.0/query-data/flux/query-median/ +list_code_example: | + ```js + data + |> quantile(q: 0.99) + ``` --- Use the [`quantile()` function](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/quantile/) diff --git a/content/v2.0/query-data/flux/regular-expressions.md b/content/v2.0/query-data/flux/regular-expressions.md index c2410923e..5bf271ef2 100644 --- a/content/v2.0/query-data/flux/regular-expressions.md +++ b/content/v2.0/query-data/flux/regular-expressions.md @@ -1,15 +1,20 @@ --- title: Use regular expressions in Flux -list_title: Use regular expressions +list_title: Regular expressions description: This guide walks through using regular expressions in evaluation logic in Flux functions. v2.0/tags: [regex] menu: v2_0: - name: Use regular expressions + name: Regular expressions parent: Query with Flux weight: 220 aliases: - - /v2.0/query-data/guides/regular-expressions/ + - /v2.0/query-data/guides/regular-expressions/ +list_code_example: | + ```js + data + |> filter(fn: (r) => r.tag =~ /^foo[0-9]/) + ``` --- Regular expressions (regexes) are incredibly powerful when matching patterns in large collections of data. diff --git a/content/v2.0/query-data/flux/scalar-values.md b/content/v2.0/query-data/flux/scalar-values.md index ff1458b2e..d6b299867 100644 --- a/content/v2.0/query-data/flux/scalar-values.md +++ b/content/v2.0/query-data/flux/scalar-values.md @@ -14,6 +14,16 @@ related: - /v2.0/reference/flux/stdlib/built-in/transformations/stream-table/ aliases: - /v2.0/query-data/guides/scalar-values/ +list_code_example: | + ```js + scalarValue = { + _record = + data + |> tableFine(fn: key => true) + |> getRecord(idx: 0) + return _record._value + } + ``` --- Use Flux [stream and table functions](/v2.0/reference/flux/stdlib/built-in/transformations/stream-table/) diff --git a/content/v2.0/query-data/flux/sql.md b/content/v2.0/query-data/flux/sql.md index 1133fae64..52daa5db6 100644 --- a/content/v2.0/query-data/flux/sql.md +++ b/content/v2.0/query-data/flux/sql.md @@ -1,6 +1,7 @@ --- title: Query SQL data sources seotitle: Query SQL data sources with InfluxDB +list_title: Query SQL data description: > The Flux `sql` package provides functions for working with SQL data sources. Use `sql.from()` to query SQL databases like PostgreSQL and MySQL @@ -8,9 +9,20 @@ v2.0/tags: [query, flux, sql] menu: v2_0: parent: Query with Flux + list_title: SQL data weight: 220 aliases: - /v2.0/query-data/guides/sql/ +list_code_example: | + ```js + import "sql" + + sql.from( + driverName: "postgres", + dataSourceName: "postgresql://user:password@localhost", + query: "SELECT * FROM example_table" + ) + ``` --- The [Flux](/v2.0/reference/flux) `sql` package provides functions for working with SQL data sources. From 6452959f3664e16012b6575f2606a544b71b204d Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Mon, 6 Apr 2020 15:05:38 -0600 Subject: [PATCH 03/23] added moving average query guide --- content/v2.0/query-data/flux/median.md | 4 +- .../v2.0/query-data/flux/moving-average.md | 108 ++++++++++++++++++ 2 files changed, 110 insertions(+), 2 deletions(-) create mode 100644 content/v2.0/query-data/flux/moving-average.md diff --git a/content/v2.0/query-data/flux/median.md b/content/v2.0/query-data/flux/median.md index e3a9cae06..4070b80fb 100644 --- a/content/v2.0/query-data/flux/median.md +++ b/content/v2.0/query-data/flux/median.md @@ -3,8 +3,8 @@ title: Find median values seotitle: Find median values in Flux list_title: Median description: > - Use the `median()` function to return a value representing the `0.5` quantile - (50th percentile) or median of input data. + Use the [`median()` function](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/median/) + to return a value representing the `0.5` quantile (50th percentile) or median of input data. weight: 210 menu: v2_0: diff --git a/content/v2.0/query-data/flux/moving-average.md b/content/v2.0/query-data/flux/moving-average.md new file mode 100644 index 000000000..2d5d42f9a --- /dev/null +++ b/content/v2.0/query-data/flux/moving-average.md @@ -0,0 +1,108 @@ +--- +title: Calculate the moving average +seotitle: Calculate the moving average in Flux +list_title: Moving Average +description: > + Use the [`movingAverage()`](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/movingaverage/) + or [`timedMovingAverage()`](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/timedmovingaverage/) + functions to return the moving average of data. +weight: 210 +menu: + v2_0: + parent: Query with Flux + name: Moving Average +v2.0/tags: [query, moving average] +list_code_example: | + ```js + data + |> movingAverage(n: 5) + + // OR + + data + |> timedMovingAverage(every: 5m, period: 10m) + ``` +--- + +Use the [`movingAverage()`](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/movingaverage/) +or [`timedMovingAverage()`](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/timedmovingaverage/) +functions to return the moving average of data. + +```js +data + |> movingAverage(n: 5) + +// OR + +data + |> timedMovingAverage(every: 5m, period: 10m) +``` + +#### movingAverage() +For each row in a table, `movingAverage()` returns the average of the current +value and the previous `n-1` values. + +#### timedMovingAverage() +For each row in a table, `timedMovingAverage()` returns the the average of the +current value and all values in the previous `period` (duration). +It returns moving averages at a frequency defined by the `every` parameter. + +**Given the following input:** + +| _time | _value | +|:----- | ------:| +| 2020-01-01T00:01:00Z | 1.0 | +| 2020-01-01T00:02:00Z | 1.2 | +| 2020-01-01T00:03:00Z | 1.8 | +| 2020-01-01T00:04:00Z | 0.9 | +| 2020-01-01T00:05:00Z | 1.4 | +| 2020-01-01T00:06:00Z | 2.0 | + +**The following functions would return:** + +--- + +{{< flex >}} +{{% flex-content %}} +**Function:** + +```js +// ... + |> movingAverage(n: 3) +``` +{{% /flex-content %}} +{{% flex-content %}} +**Output:** + +| _time | _value | +|:----- | ------:| +| 2020-01-01T00:03:00Z | 1.33 | +| 2020-01-01T00:04:00Z | 1.30 | +| 2020-01-01T00:05:00Z | 1.06 | +| 2020-01-01T00:06:00Z | 1.43 | +{{% /flex-content %}} +{{< /flex >}} + +--- + +{{< flex >}} +{{% flex-content %}} +**Function:** + +```js +// ... + |> timedMovingAverage( + every: 2m, + period: 4m + ) +``` +{{% /flex-content %}} +{{% flex-content %}} +**Output:** + +| _time | _value | +|:----- | ------:| +| 2020-01-01T00:04:00Z | 1.23 | +| 2020-01-01T00:06:00Z | 1.53 | +{{% /flex-content %}} +{{< /flex >}} From 46c2fa14545b3f311d0d3030e803692c5c394321 Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Mon, 6 Apr 2020 22:01:28 -0600 Subject: [PATCH 04/23] added increase query guide --- content/v2.0/query-data/flux/increase.md | 57 ++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 content/v2.0/query-data/flux/increase.md diff --git a/content/v2.0/query-data/flux/increase.md b/content/v2.0/query-data/flux/increase.md new file mode 100644 index 000000000..4f6e10cc7 --- /dev/null +++ b/content/v2.0/query-data/flux/increase.md @@ -0,0 +1,57 @@ +--- +title: Calculate the increase +seotitle: Calculate the increase in Flux +list_title: Increase +description: > + Use the [`increase()` function](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/increase/) + to calculate the increase in values since the beginning of the series or table. + This function is especially useful when tracking changes in counter values which + wrap over time or periodically reset. +weight: 210 +menu: + v2_0: + parent: Query with Flux + name: Increase +v2.0/tags: [query, increase, counters] +list_code_example: | + ```js + data + |> increase() + ``` +--- + +Use the [`increase()` function](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/increase/) +to calculate the increase of values in a table. +This function is especially useful when tracking changes in counter values which +wrap over time or periodically reset. + +```js +data + |> increase() +``` + +{{< flex >}} +{{% flex-content %}} +**Given the following input:** + +| _time | _value | +|:----- | ------:| +| 0001 | 1 | +| 0002 | 2 | +| 0003 | 8 | +| 0004 | 10 | +| 0005 | 0 | +| 0006 | 4 | +{{% /flex-content %}} +{{% flex-content %}} +**`increase()` returns:** + +| _time | _value | +|:----- | ------:| +| 0002 | 1 | +| 0003 | 7 | +| 0004 | 9 | +| 0005 | 9 | +| 0006 | 13 | +{{% /flex-content %}} +{{< /flex >}} From df36bfd92e72b5303514d86a03422a5c01ad58d5 Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Tue, 7 Apr 2020 14:09:15 -0600 Subject: [PATCH 05/23] added tables and diagram to show how moving averages work --- assets/styles/layouts/article/_svgs.scss | 8 ++ .../v2.0/query-data/flux/moving-average.md | 77 +++++++++++-------- static/svgs/timed-moving-avg.svg | 56 ++++++++++++++ 3 files changed, 110 insertions(+), 31 deletions(-) create mode 100644 static/svgs/timed-moving-avg.svg diff --git a/assets/styles/layouts/article/_svgs.scss b/assets/styles/layouts/article/_svgs.scss index c5324b663..0eda1c274 100644 --- a/assets/styles/layouts/article/_svgs.scss +++ b/assets/styles/layouts/article/_svgs.scss @@ -24,6 +24,14 @@ svg { .geo-region{fill:rgba($svg-geo-region, 0.35);stroke:$svg-geo-region;stroke-width:3;stroke-linejoin:round;stroke-miterlimit:10;} .geo-point{fill:$svg-geo-point;} } + + &#timed-moving-average { + margin: 1rem 0 3rem; + max-width: 425px; + .st0 {stroke: $article-text;} + .st1 {fill: $article-text;} + .st2 {font-family: $rubik; font-weight: $medium} + } } //////////////////////////// Styles for SVG legends //////////////////////////// diff --git a/content/v2.0/query-data/flux/moving-average.md b/content/v2.0/query-data/flux/moving-average.md index 2d5d42f9a..08e582493 100644 --- a/content/v2.0/query-data/flux/moving-average.md +++ b/content/v2.0/query-data/flux/moving-average.md @@ -38,15 +38,22 @@ data |> timedMovingAverage(every: 5m, period: 10m) ``` -#### movingAverage() -For each row in a table, `movingAverage()` returns the average of the current -value and the previous `n-1` values. +### movingAverage() +For each row in a table, `movingAverage()` returns the average of the current value and +**previous** values where `n` is the total number of values used to calculate the average. -#### timedMovingAverage() -For each row in a table, `timedMovingAverage()` returns the the average of the -current value and all values in the previous `period` (duration). -It returns moving averages at a frequency defined by the `every` parameter. +If `n = 3`: +| Row # | Calculation | +|:-----:|:----------- | +| 1 | _Insufficient number of rows_ | +| 2 | _Insufficient number of rows_ | +| 3 | (Row1 + Row2 + Row3) / 3 | +| 4 | (Row2 + Row3 + Row4) / 3 | +| 5 | (Row3 + Row4 + Row5) / 3 | + +{{< flex >}} +{{% flex-content %}} **Given the following input:** | _time | _value | @@ -57,22 +64,13 @@ It returns moving averages at a frequency defined by the `every` parameter. | 2020-01-01T00:04:00Z | 0.9 | | 2020-01-01T00:05:00Z | 1.4 | | 2020-01-01T00:06:00Z | 2.0 | - -**The following functions would return:** - ---- - -{{< flex >}} -{{% flex-content %}} -**Function:** - -```js -// ... - |> movingAverage(n: 3) -``` {{% /flex-content %}} {{% flex-content %}} -**Output:** +**The following would return:** + +```js +|> movingAverage(n: 3) +``` | _time | _value | |:----- | ------:| @@ -83,22 +81,39 @@ It returns moving averages at a frequency defined by the `every` parameter. {{% /flex-content %}} {{< /flex >}} ---- +### timedMovingAverage() +For each row in a table, `timedMovingAverage()` returns the average of the +current value and all row values in the **previous** `period` (duration). +It returns moving averages at a frequency defined by the `every` parameter. + +Each color in the diagram below represents a period of time used to calculate an +average and the time a point representing the average is returned. +If `every = 30m` and `period = 1h`: + +{{< svg "/static/svgs/timed-moving-avg.svg" >}} {{< flex >}} {{% flex-content %}} -**Function:** +**Given the following input:** -```js -// ... - |> timedMovingAverage( - every: 2m, - period: 4m - ) -``` +| _time | _value | +|:----- | ------:| +| 2020-01-01T00:01:00Z | 1.0 | +| 2020-01-01T00:02:00Z | 1.2 | +| 2020-01-01T00:03:00Z | 1.8 | +| 2020-01-01T00:04:00Z | 0.9 | +| 2020-01-01T00:05:00Z | 1.4 | +| 2020-01-01T00:06:00Z | 2.0 | {{% /flex-content %}} {{% flex-content %}} -**Output:** +**The following would return:** + +```js +|> timedMovingAverage( + every: 2m, + period: 4m +) +``` | _time | _value | |:----- | ------:| diff --git a/static/svgs/timed-moving-avg.svg b/static/svgs/timed-moving-avg.svg new file mode 100644 index 000000000..51a05911c --- /dev/null +++ b/static/svgs/timed-moving-avg.svg @@ -0,0 +1,56 @@ + + + + + + + + + + + + +0:00 +0:30 +1:00 +1:30 +2:00 +2:30 +3:00 + + + + + + + + + +3:00 +2:30 +2:00 +1:30 +1:00 + + From 15ec3b762b8249edfb48afb55bfb976f6051c60e Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Tue, 7 Apr 2020 15:07:08 -0600 Subject: [PATCH 06/23] updated timedMovingAverage diagram and examples --- .../v2.0/query-data/flux/moving-average.md | 8 +- static/svgs/timed-moving-avg.svg | 91 ++++++++++--------- 2 files changed, 54 insertions(+), 45 deletions(-) diff --git a/content/v2.0/query-data/flux/moving-average.md b/content/v2.0/query-data/flux/moving-average.md index 08e582493..a12c3fe88 100644 --- a/content/v2.0/query-data/flux/moving-average.md +++ b/content/v2.0/query-data/flux/moving-average.md @@ -76,7 +76,7 @@ If `n = 3`: |:----- | ------:| | 2020-01-01T00:03:00Z | 1.33 | | 2020-01-01T00:04:00Z | 1.30 | -| 2020-01-01T00:05:00Z | 1.06 | +| 2020-01-01T00:05:00Z | 1.36 | | 2020-01-01T00:06:00Z | 1.43 | {{% /flex-content %}} {{< /flex >}} @@ -117,7 +117,9 @@ If `every = 30m` and `period = 1h`: | _time | _value | |:----- | ------:| -| 2020-01-01T00:04:00Z | 1.23 | -| 2020-01-01T00:06:00Z | 1.53 | +| 2020-01-01T00:02:00Z | 1.000 | +| 2020-01-01T00:04:00Z | 1.333 | +| 2020-01-01T00:06:00Z | 1.325 | +| 2020-01-01T00:06:00Z | 1.150 | {{% /flex-content %}} {{< /flex >}} diff --git a/static/svgs/timed-moving-avg.svg b/static/svgs/timed-moving-avg.svg index 51a05911c..c5f55c9d1 100644 --- a/static/svgs/timed-moving-avg.svg +++ b/static/svgs/timed-moving-avg.svg @@ -1,56 +1,63 @@ + viewBox="0 0 340 183" style="enable-background:new 0 0 340 183;" xml:space="preserve"> - + - - - - - - - + + + + + + + -0:00 -0:30 -1:00 -1:30 -2:00 -2:30 -3:00 - - - - - - - - - -3:00 -2:30 -2:00 -1:30 -1:00 - +0:00 +0:30 +1:00 +1:30 +2:00 +2:30 +3:00 + + + + + + + + + + +3:00 +2:30 +2:00 +1:30 +1:00 + + +0:30 + From b2f8ccd831e560b8d93fde39d39bc5f64059fbf7 Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Tue, 7 Apr 2020 15:40:01 -0600 Subject: [PATCH 07/23] updated increase doc, address PR feedback --- content/v2.0/query-data/flux/increase.md | 11 +++++++---- .../built-in/transformations/aggregates/increase.md | 12 +++++++----- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/content/v2.0/query-data/flux/increase.md b/content/v2.0/query-data/flux/increase.md index 4f6e10cc7..1b5ff21f0 100644 --- a/content/v2.0/query-data/flux/increase.md +++ b/content/v2.0/query-data/flux/increase.md @@ -4,8 +4,8 @@ seotitle: Calculate the increase in Flux list_title: Increase description: > Use the [`increase()` function](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/increase/) - to calculate the increase in values since the beginning of the series or table. - This function is especially useful when tracking changes in counter values which + to track increases across multiple columns in a table. + This function is especially useful when tracking changes in counter values that wrap over time or periodically reset. weight: 210 menu: @@ -21,8 +21,8 @@ list_code_example: | --- Use the [`increase()` function](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/increase/) -to calculate the increase of values in a table. -This function is especially useful when tracking changes in counter values which +to track increases across multiple columns in a table. +This function is especially useful when tracking changes in counter values that wrap over time or periodically reset. ```js @@ -30,6 +30,9 @@ data |> increase() ``` +`increase()` returns a cumulative sum of **non-negative** differences between rows in a table. +For example: + {{< flex >}} {{% flex-content %}} **Given the following input:** diff --git a/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/increase.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/increase.md index 7528cca0f..cfb8afb87 100644 --- a/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/increase.md +++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/increase.md @@ -1,6 +1,8 @@ --- title: increase() function -description: The `increase()` function calculates the total non-negative difference between values in a table. +description: > + The `increase()` function calculates the cumulative sum of **non-negative** differences + between subsequent values. aliases: - /v2.0/reference/flux/functions/transformations/aggregates/increase - /v2.0/reference/flux/functions/built-in/transformations/aggregates/increase/ @@ -11,8 +13,8 @@ menu: weight: 501 --- -The `increase()` function calculates the total non-negative difference between -subsequent values. +The `increase()` function calculates the cumulative sum of **non-negative** differences +between subsequent values. A main use case is tracking changes in counter values which may wrap over time when they hit a threshold or are reset. In the case of a wrap/reset, we can assume that the absolute delta between two @@ -58,8 +60,8 @@ Given the following input table: | _time | _value | | ----- | ------ | | 00002 | 4 | -| 00003 | 7 | -| 00004 | 8 | +| 00003 | 4 | +| 00004 | 5 | ## Function definition ```js From 2f426b5f2fe50dd27e020fa6e7009a1cfd41b682 Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Tue, 7 Apr 2020 16:29:51 -0600 Subject: [PATCH 08/23] adde first and last query guide --- content/v2.0/query-data/flux/first-last.md | 125 +++++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 content/v2.0/query-data/flux/first-last.md diff --git a/content/v2.0/query-data/flux/first-last.md b/content/v2.0/query-data/flux/first-last.md new file mode 100644 index 000000000..2aaca0be4 --- /dev/null +++ b/content/v2.0/query-data/flux/first-last.md @@ -0,0 +1,125 @@ +--- +title: Query first and last values +seotitle: Query first and last values in Flux +list_title: First and last +description: > + Use the [`first()`](/v2.0/reference/flux/stdlib/built-in/transformations/selectors/first/) or + [`last()`](/v2.0/reference/flux/stdlib/built-in/transformations/selectors/first/) functions + to return the first or last point in an input table. +weight: 210 +menu: + v2_0: + parent: Query with Flux + name: First & last +v2.0/tags: [query] +list_code_example: | + ```js + data + |> first() + + // OR + + data + |> last() + ``` +--- + +Use the [`first()`](/v2.0/reference/flux/stdlib/built-in/transformations/selectors/first/) or +[`last()`](/v2.0/reference/flux/stdlib/built-in/transformations/selectors/first/) functions +to return the first or last point in an input table. + +```js +data + |> first() + +// OR + +data + |> last() +``` + +{{% note %}} +By default, InfluxDB returns results sorted by time, however you can use the +[`sort()` function](/v2.0/reference/flux/stdlib/built-in/transformations/sort/) +to change how results are sorted. +**`first()` and `last()` respect the sorting of input tables.** +{{% /note %}} + +### first +`first()` returns the first non-null record in an input table. + +{{< flex >}} +{{% flex-content %}} +**Given the following input:** + +| _time | _value | +| ----- |:------:| +| 0001 | 1.0 | +| 0002 | 1.0 | +| 0003 | 2.0 | +| 0004 | 3.0 | +{{% /flex-content %}} +{{% flex-content %}} +**The following function returns:** +```js +|> first() +``` + +| _time | _value | +| ----- |:------:| +| 0001 | 1.0 | +{{% /flex-content %}} +{{< /flex >}} + +### last +`first()` returns the last non-null record in an input table. + +{{< flex >}} +{{% flex-content %}} +**Given the following input:** + +| _time | _value | +| ----- |:------:| +| 0001 | 1.0 | +| 0002 | 1.0 | +| 0003 | 2.0 | +| 0004 | 3.0 | +{{% /flex-content %}} +{{% flex-content %}} +**The following function returns:** + +```js +|> last() +``` + +| _time | _value | +| ----- |:------:| +| 0004 | 3.0 | +{{% /flex-content %}} +{{< /flex >}} + +## Use first() or last() with aggregateWindow() +[`aggregateWindow()`](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/aggregatewindow/) +segments data into windows of time, aggregates data in each window into a single +point, and then removes the time-based segmentation. +It is primarily used to [downsample data](/v2.0/process-data/common-tasks/downsample-data/). +`aggregateWindow` supports selector functions such as `first()` and `last()`. + +{{< code-tabs-wrapper >}} +{{% code-tabs %}} +[first](#) +[last](#) +{{% /code-tabs %}} +{{% code-tab-content %}} +```js +data + |> aggregateWindow(every: 5m, fn: first) +``` +{{% /code-tab-content %}} +{{% code-tab-content %}} +```js +data + |> aggregateWindow(every: 5m, fn: last) +``` +{{% /code-tab-content %}} +{{< /code-tabs-wrapper >}} From 205f163d2bfaae8c7e2324464cbcb0946d91e9bc Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Tue, 7 Apr 2020 21:26:52 -0600 Subject: [PATCH 09/23] updated first-last guide to address PR feedback --- content/v2.0/query-data/flux/first-last.md | 62 +++++++++++++++++----- 1 file changed, 48 insertions(+), 14 deletions(-) diff --git a/content/v2.0/query-data/flux/first-last.md b/content/v2.0/query-data/flux/first-last.md index 2aaca0be4..92761363c 100644 --- a/content/v2.0/query-data/flux/first-last.md +++ b/content/v2.0/query-data/flux/first-last.md @@ -4,7 +4,7 @@ seotitle: Query first and last values in Flux list_title: First and last description: > Use the [`first()`](/v2.0/reference/flux/stdlib/built-in/transformations/selectors/first/) or - [`last()`](/v2.0/reference/flux/stdlib/built-in/transformations/selectors/first/) functions + [`last()`](/v2.0/reference/flux/stdlib/built-in/transformations/selectors/last/) functions to return the first or last point in an input table. weight: 210 menu: @@ -25,8 +25,8 @@ list_code_example: | --- Use the [`first()`](/v2.0/reference/flux/stdlib/built-in/transformations/selectors/first/) or -[`last()`](/v2.0/reference/flux/stdlib/built-in/transformations/selectors/first/) functions -to return the first or last point in an input table. +[`last()`](/v2.0/reference/flux/stdlib/built-in/transformations/selectors/last/) functions +to return the first or last record in an input table. ```js data @@ -42,7 +42,8 @@ data By default, InfluxDB returns results sorted by time, however you can use the [`sort()` function](/v2.0/reference/flux/stdlib/built-in/transformations/sort/) to change how results are sorted. -**`first()` and `last()` respect the sorting of input tables.** +`first()` and `last()` respect the sort order of input data and return records +based on the order they are received in. {{% /note %}} ### first @@ -72,7 +73,7 @@ to change how results are sorted. {{< /flex >}} ### last -`first()` returns the last non-null record in an input table. +`last()` returns the last non-null record in an input table. {{< flex >}} {{% flex-content %}} @@ -99,12 +100,28 @@ to change how results are sorted. {{< /flex >}} ## Use first() or last() with aggregateWindow() -[`aggregateWindow()`](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/aggregatewindow/) -segments data into windows of time, aggregates data in each window into a single -point, and then removes the time-based segmentation. -It is primarily used to [downsample data](/v2.0/process-data/common-tasks/downsample-data/). -`aggregateWindow` supports selector functions such as `first()` and `last()`. +Use `first()` and `last()` with [`aggregateWindow()`](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/aggregatewindow/) +to select the first or last records in time-based groups. +`aggregateWindow()` segments data into windows of time, aggregates data in each window into a single +point using aggregate or selector functions, and then removes the time-based segmentation. + +{{< flex >}} +{{% flex-content %}} +**Given the following input:** + +| _time | _value | +|:----- | ------:| +| 2020-01-01T00:00:00Z | 10 | +| 2020-01-01T00:00:15Z | 12 | +| 2020-01-01T00:00:45Z | 9 | +| 2020-01-01T00:01:05Z | 9 | +| 2020-01-01T00:01:10Z | 15 | +| 2020-01-01T00:02:30Z | 11 | +{{% /flex-content %}} + +{{% flex-content %}} +**The following function returns:** {{< code-tabs-wrapper >}} {{% code-tabs %}} [first](#) @@ -112,14 +129,31 @@ It is primarily used to [downsample data](/v2.0/process-data/common-tasks/downsa {{% /code-tabs %}} {{% code-tab-content %}} ```js -data - |> aggregateWindow(every: 5m, fn: first) +|> aggregateWindow( + every: 1h, + fn: first +) ``` +| _time | _value | +|:----- | ------:| +| 2020-01-01T00:00:59Z | 10 | +| 2020-01-01T00:01:59Z | 9 | +| 2020-01-01T00:02:59Z | 11 | {{% /code-tab-content %}} {{% code-tab-content %}} ```js -data - |> aggregateWindow(every: 5m, fn: last) +|> aggregateWindow( + every: 1h, + fn: last +) ``` + +| _time | _value | +|:----- | ------:| +| 2020-01-01T00:00:59Z | 9 | +| 2020-01-01T00:01:59Z | 15 | +| 2020-01-01T00:02:59Z | 11 | {{% /code-tab-content %}} {{< /code-tabs-wrapper >}} +{{%/flex-content %}} +{{< /flex >}} From e7cd5d45e00172cc4ab37eb38045ff1eb54263ef Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Wed, 8 Apr 2020 09:55:11 -0600 Subject: [PATCH 10/23] WIP fill query guide --- content/v2.0/query-data/flux/fill.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 content/v2.0/query-data/flux/fill.md diff --git a/content/v2.0/query-data/flux/fill.md b/content/v2.0/query-data/flux/fill.md new file mode 100644 index 000000000..699883acd --- /dev/null +++ b/content/v2.0/query-data/flux/fill.md @@ -0,0 +1,26 @@ +--- +title: Fill gaps in data +seotitle: Fill gaps in data +list_title: Fill gaps +description: > + Use the [`fill()` function](/v2.0/reference/flux/stdlib/built-in/transformations/fill/) + to replace _null_ values in query results. +weight: 210 +menu: + v2_0: + parent: Query with Flux + name: Fill gaps +v2.0/tags: [query, fill] +list_code_example: | + ```js + data + |> fill(usePrevious: true) + ``` +--- + +Use the [`fill()` function](/v2.0/reference/flux/stdlib/built-in/transformations/fill/) +to replace _null_ values in query results. + +- Fill with a value +- Fill with previous +- Interpolate From c2d6537d22372ef3b1d97b13ed833a63dcf19d5f Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Mon, 13 Apr 2020 09:41:40 -0600 Subject: [PATCH 11/23] fill query guide --- content/v2.0/query-data/flux/fill.md | 105 +++++++++++++++++++++++++-- 1 file changed, 98 insertions(+), 7 deletions(-) diff --git a/content/v2.0/query-data/flux/fill.md b/content/v2.0/query-data/flux/fill.md index 699883acd..4863f45f5 100644 --- a/content/v2.0/query-data/flux/fill.md +++ b/content/v2.0/query-data/flux/fill.md @@ -1,7 +1,7 @@ --- -title: Fill gaps in data -seotitle: Fill gaps in data -list_title: Fill gaps +title: Fill null values in data +seotitle: Fill null values in data +list_title: Fill null values description: > Use the [`fill()` function](/v2.0/reference/flux/stdlib/built-in/transformations/fill/) to replace _null_ values in query results. @@ -9,7 +9,7 @@ weight: 210 menu: v2_0: parent: Query with Flux - name: Fill gaps + name: Fill v2.0/tags: [query, fill] list_code_example: | ```js @@ -21,6 +21,97 @@ list_code_example: | Use the [`fill()` function](/v2.0/reference/flux/stdlib/built-in/transformations/fill/) to replace _null_ values in query results. -- Fill with a value -- Fill with previous -- Interpolate + +- [Use the previous non-null value](#fill-with-the-previous-value) to replace _null_ values +- [Specify a value](#fill-with-a-specified-value) to replace _null_ values + + +```js +data + |> fill(usePrevious: true) + +// OR + +data + |> fill(value: 0.0) +``` + +{{% note %}} +#### Fill empty windows of time +The `fill()` function **does not** fill empty windows of time. +It only replaces _null_ values in existing data. +Filling empty windows of time requires time interpolation +_(see [influxdata/flux#2428](https://github.com/influxdata/flux/issues/2428))_. +{{% /note %}} + +## Fill with the previous value +To fill _null_ values with the previous **non-null** value, set the `usePrevious` parameter to `true`. + +{{% note %}} +Values remain _null_ if there is no previous non-null value in the table. +{{% /note %}} + +```js +data + |> fill(usePrevious: true) +``` + +{{< flex >}} +{{% flex-content %}} +**Given the following input:** + +| _time | _value | +|:----- | ------:| +| 0001 | null | +| 0002 | 0.8 | +| 0003 | null | +| 0004 | null | +| 0005 | 1.4 | +{{% /flex-content %}} +{{% flex-content %}} +**`fill(usePrevious: true)` returns:** + +| _time | _value | +|:----- | ------:| +| 0001 | null | +| 0002 | 0.8 | +| 0003 | 0.8 | +| 0004 | 0.8 | +| 0005 | 1.4 | +{{% /flex-content %}} +{{< /flex >}} + +## Fill with a specified value +To fill _null_ values with a specified value, use the `value` parameter to specify the fill value. +_The fill value must match the [data type](/v2.0/reference/flux/language/types/#basic-types) +of the [column](/v2.0/reference/flux/stdlib/built-in/transformations/fill/#column)._ + +```js +data + |> fill(value: 0.0) +``` + +{{< flex >}} +{{% flex-content %}} +**Given the following input:** + +| _time | _value | +|:----- | ------:| +| 0001 | null | +| 0002 | 0.8 | +| 0003 | null | +| 0004 | null | +| 0005 | 1.4 | +{{% /flex-content %}} +{{% flex-content %}} +**`fill(value: 0.0)` returns:** + +| _time | _value | +|:----- | ------:| +| 0001 | 0.0 | +| 0002 | 0.8 | +| 0003 | 0.0 | +| 0004 | 0.0 | +| 0005 | 1.4 | +{{% /flex-content %}} +{{< /flex >}} From f71e85ee1ce4246111b921c81435df1669c043e7 Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Thu, 23 Apr 2020 15:24:44 -0600 Subject: [PATCH 12/23] updated fill query guide to address PR feedback --- content/v2.0/query-data/flux/fill.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/content/v2.0/query-data/flux/fill.md b/content/v2.0/query-data/flux/fill.md index 4863f45f5..e23cf0706 100644 --- a/content/v2.0/query-data/flux/fill.md +++ b/content/v2.0/query-data/flux/fill.md @@ -1,10 +1,10 @@ --- title: Fill null values in data seotitle: Fill null values in data -list_title: Fill null values +list_title: Fill description: > Use the [`fill()` function](/v2.0/reference/flux/stdlib/built-in/transformations/fill/) - to replace _null_ values in query results. + to replace _null_ values. weight: 210 menu: v2_0: @@ -19,11 +19,10 @@ list_code_example: | --- Use the [`fill()` function](/v2.0/reference/flux/stdlib/built-in/transformations/fill/) -to replace _null_ values in query results. +to replace _null_ values with: - -- [Use the previous non-null value](#fill-with-the-previous-value) to replace _null_ values -- [Specify a value](#fill-with-a-specified-value) to replace _null_ values +- [the previous non-null value](#fill-with-the-previous-value) +- [a specified value](#fill-with-a-specified-value) ```js From bfefaff3ef09a6082df4e87bec757617db4ad1ed Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Thu, 23 Apr 2020 15:52:51 -0600 Subject: [PATCH 13/23] fixed import statement on aggregate.rate doc --- .../v2.0/reference/flux/stdlib/experimental/aggregate/rate.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/v2.0/reference/flux/stdlib/experimental/aggregate/rate.md b/content/v2.0/reference/flux/stdlib/experimental/aggregate/rate.md index d5034eab9..88e395ab9 100644 --- a/content/v2.0/reference/flux/stdlib/experimental/aggregate/rate.md +++ b/content/v2.0/reference/flux/stdlib/experimental/aggregate/rate.md @@ -14,7 +14,7 @@ The `aggregate.rate()` function calculates the rate of change per windows of tim _**Function type:** Transformation_ ```js -import "experimental/query" +import "experimental/aggregate" aggregate.rate( every: 1m, From af13632d75106055265c93c221dba0935d031468 Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Thu, 23 Apr 2020 16:55:32 -0600 Subject: [PATCH 14/23] added rate query guide --- content/v2.0/query-data/flux/rate.md | 73 ++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 content/v2.0/query-data/flux/rate.md diff --git a/content/v2.0/query-data/flux/rate.md b/content/v2.0/query-data/flux/rate.md new file mode 100644 index 000000000..8ef50566d --- /dev/null +++ b/content/v2.0/query-data/flux/rate.md @@ -0,0 +1,73 @@ +--- +title: Calculate the rate of change +seotitle: Calculate the rate of change in Flux +list_title: Rate +description: > + Use the [`aggregate.rate()` function](/v2.0/reference/flux/stdlib/experimental/aggregate/rate/) + to calculate the average rate of change per window of time. +weight: 210 +menu: + v2_0: + parent: Query with Flux + name: Rate +v2.0/tags: [query, rate] +related: + - /v2.0/reference/flux/stdlib/experimental/aggregate/rate/ +list_code_example: | + ```js + import "experimental/aggregate" + + data + |> aggregate.rate(every: 1m, unit: 1s ) + ``` +--- + +Use the [`aggregate.rate()` function](/v2.0/reference/flux/stdlib/experimental/aggregate/rate/) +to calculate the average rate of change per window of time. + +```js +import "experimental/aggregate" + +data + |> aggregate.rate( + every: 1m, + unit: 1s, + groupColumns: ["tag1", "tag2"] + ) +``` + +`aggregate.rate()` returns the average rate of change per `unit` for time intervals defined by `every`. + +{{< flex >}} +{{% flex-content %}} +**Given the following input:** + +| _time | _value | +|:----- | ------:| +| 2020-01-01T00:00:00Z | 250 | +| 2020-01-01T00:10:00Z | 160 | +| 2020-01-01T00:20:00Z | 150 | +| 2020-01-01T00:30:00Z | 220 | +| 2020-01-01T00:40:00Z | 200 | +| 2020-01-01T00:50:00Z | 290 | +| 2020-01-01T01:00:00Z | 340 | +{{% /flex-content %}} +{{% flex-content %}} +**The following returns:** + +```js + |> aggregate.rate( + every: 20m, + unit: 1m + ) +``` + +| _time | _value | +|:----- | ------:| +| 2020-01-01T00:40:00Z | 7 | +| 2020-01-01T01:00:00Z | 9 | +| 2020-01-01T01:10:00Z | 5 | +{{% /flex-content %}} +{{< /flex >}} + +_Results represent the **average change rate per minute** of every **20 minute interval**._ From a3f4f4b900899e03b74ecb351a5abfcc224631a9 Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Thu, 23 Apr 2020 16:57:47 -0600 Subject: [PATCH 15/23] removed unnecessary indentation from rate code block --- content/v2.0/query-data/flux/rate.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/content/v2.0/query-data/flux/rate.md b/content/v2.0/query-data/flux/rate.md index 8ef50566d..027b65cd8 100644 --- a/content/v2.0/query-data/flux/rate.md +++ b/content/v2.0/query-data/flux/rate.md @@ -56,10 +56,10 @@ data **The following returns:** ```js - |> aggregate.rate( - every: 20m, - unit: 1m - ) +|> aggregate.rate( + every: 20m, + unit: 1m +) ``` | _time | _value | From b41e34b9e360d68ae851c246063f8a6ef7722968 Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Thu, 23 Apr 2020 17:03:14 -0600 Subject: [PATCH 16/23] fixed time value in rate example table --- content/v2.0/query-data/flux/rate.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/v2.0/query-data/flux/rate.md b/content/v2.0/query-data/flux/rate.md index 027b65cd8..b10762041 100644 --- a/content/v2.0/query-data/flux/rate.md +++ b/content/v2.0/query-data/flux/rate.md @@ -66,7 +66,7 @@ data |:----- | ------:| | 2020-01-01T00:40:00Z | 7 | | 2020-01-01T01:00:00Z | 9 | -| 2020-01-01T01:10:00Z | 5 | +| 2020-01-01T01:20:00Z | 5 | {{% /flex-content %}} {{< /flex >}} From 5db8e451e3e281abc967eeedd42f9845176b602c Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Fri, 24 Apr 2020 09:37:03 -0600 Subject: [PATCH 17/23] added derivative to rate query guide --- content/v2.0/query-data/flux/rate.md | 111 ++++++++++++++++++++++++++- 1 file changed, 108 insertions(+), 3 deletions(-) diff --git a/content/v2.0/query-data/flux/rate.md b/content/v2.0/query-data/flux/rate.md index b10762041..e61e2474e 100644 --- a/content/v2.0/query-data/flux/rate.md +++ b/content/v2.0/query-data/flux/rate.md @@ -3,7 +3,9 @@ title: Calculate the rate of change seotitle: Calculate the rate of change in Flux list_title: Rate description: > - Use the [`aggregate.rate()` function](/v2.0/reference/flux/stdlib/experimental/aggregate/rate/) + Use the [`derivative()` function](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/derivative/) + to calculate the rate of change between subsequent values or the + [`aggregate.rate()` function](/v2.0/reference/flux/stdlib/experimental/aggregate/rate/) to calculate the average rate of change per window of time. weight: 210 menu: @@ -14,14 +16,113 @@ v2.0/tags: [query, rate] related: - /v2.0/reference/flux/stdlib/experimental/aggregate/rate/ list_code_example: | + ```js + data + |> derivative(unit: 1s, nonNegative: true) + ``` ```js import "experimental/aggregate" data - |> aggregate.rate(every: 1m, unit: 1s ) + |> aggregate.rate(every: 1m, unit: 1s) ``` --- + +Use the [`derivative()` function](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/derivative/) +to calculate the rate of change between subsequent values or the +[`aggregate.rate()` function](/v2.0/reference/flux/stdlib/experimental/aggregate/rate/) +to calculate the average rate of change per window of time. + +- [Rate of change between subsequent values](#rate-of-change-between-subsequent-values) +- [Average rate of change per window of time](#average-rate-of-change-per-window-of-time) + +## Rate of change between subsequent values +Use the [`derivative()` function](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/derivative/) +to calculate the rate of change per unit of time between subsequent _non-null_ values. + +```js +data + |> derivative(unit: 1s) +``` + +By default, `derivative()` returns only positive derivative values and replaces negative values with _null_. + + +{{< flex >}} +{{% flex-content %}} +**Given the following input:** + +| _time | _value | +|:----- | ------:| +| 2020-01-01T00:00:00Z | 250 | +| 2020-01-01T00:10:00Z | 160 | +| 2020-01-01T00:20:00Z | 150 | +| 2020-01-01T00:30:00Z | 220 | +| 2020-01-01T00:40:00Z | 200 | +| 2020-01-01T00:50:00Z | 290 | +| 2020-01-01T01:00:00Z | 340 | +{{% /flex-content %}} +{{% flex-content %}} +**`derivative(unit: 1m)` returns:** + +| _time | _value | +|:----- | ------:| +| 2020-01-01T00:10:00Z | | +| 2020-01-01T00:20:00Z | | +| 2020-01-01T00:30:00Z | 7 | +| 2020-01-01T00:40:00Z | | +| 2020-01-01T00:50:00Z | 9 | +| 2020-01-01T01:00:00Z | 5 | +{{% /flex-content %}} +{{< /flex >}} + +Results represent the average change per minute between subsequent values with +negative values set to _null_. + +### Return negative derivative values +To return negative derivative values, set the `nonNegative` parameter to `false`, + +{{< flex >}} +{{% flex-content %}} +**Given the following input:** + +| _time | _value | +|:----- | ------:| +| 2020-01-01T00:00:00Z | 250 | +| 2020-01-01T00:10:00Z | 160 | +| 2020-01-01T00:20:00Z | 150 | +| 2020-01-01T00:30:00Z | 220 | +| 2020-01-01T00:40:00Z | 200 | +| 2020-01-01T00:50:00Z | 290 | +| 2020-01-01T01:00:00Z | 340 | +{{% /flex-content %}} +{{% flex-content %}} +**The following returns:** + +```js +|> derivative( + unit: 1m, + nonNegative: false +) +``` + +| _time | _value | +|:----- | ------:| +| 2020-01-01T00:10:00Z | -9 | +| 2020-01-01T00:20:00Z | -1 | +| 2020-01-01T00:30:00Z | 7 | +| 2020-01-01T00:40:00Z | -2 | +| 2020-01-01T00:50:00Z | 9 | +| 2020-01-01T01:00:00Z | 5 | +{{% /flex-content %}} +{{< /flex >}} + +Results represent the average change per minute between subsequent values and +include negative values. + +## Average rate of change per window of time + Use the [`aggregate.rate()` function](/v2.0/reference/flux/stdlib/experimental/aggregate/rate/) to calculate the average rate of change per window of time. @@ -37,6 +138,7 @@ data ``` `aggregate.rate()` returns the average rate of change per `unit` for time intervals defined by `every`. +**Negative values are replaced with _null_.** {{< flex >}} {{% flex-content %}} @@ -64,10 +166,13 @@ data | _time | _value | |:----- | ------:| +| 2020-01-01T00:20:00Z | | | 2020-01-01T00:40:00Z | 7 | | 2020-01-01T01:00:00Z | 9 | | 2020-01-01T01:20:00Z | 5 | {{% /flex-content %}} {{< /flex >}} -_Results represent the **average change rate per minute** of every **20 minute interval**._ +Results represent the **average change rate per minute** of every **20 minute interval** +with negative values set to _null_. +Timestamps represent the right bound of the time window used to average values. From e0caf618073730ca744380dbaec96d8726ca952b Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Fri, 24 Apr 2020 09:38:40 -0600 Subject: [PATCH 18/23] fixed typos in rate query guide --- content/v2.0/query-data/flux/rate.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/v2.0/query-data/flux/rate.md b/content/v2.0/query-data/flux/rate.md index e61e2474e..9b781eda4 100644 --- a/content/v2.0/query-data/flux/rate.md +++ b/content/v2.0/query-data/flux/rate.md @@ -77,7 +77,7 @@ By default, `derivative()` returns only positive derivative values and replaces {{% /flex-content %}} {{< /flex >}} -Results represent the average change per minute between subsequent values with +Results represent the rate of change **per minute** between subsequent values with negative values set to _null_. ### Return negative derivative values @@ -118,7 +118,7 @@ To return negative derivative values, set the `nonNegative` parameter to `false` {{% /flex-content %}} {{< /flex >}} -Results represent the average change per minute between subsequent values and +Results represent the rate of change **per minute** between subsequent values and include negative values. ## Average rate of change per window of time From 7fa14a480b771765d3f07dde8556f82d30b5dad8 Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Fri, 24 Apr 2020 10:27:31 -0600 Subject: [PATCH 19/23] adjusted sample data for rate query guide, added more details --- content/v2.0/query-data/flux/rate.md | 74 ++++++++++++++++------------ 1 file changed, 42 insertions(+), 32 deletions(-) diff --git a/content/v2.0/query-data/flux/rate.md b/content/v2.0/query-data/flux/rate.md index 9b781eda4..ad3f2fa9f 100644 --- a/content/v2.0/query-data/flux/rate.md +++ b/content/v2.0/query-data/flux/rate.md @@ -7,6 +7,8 @@ description: > to calculate the rate of change between subsequent values or the [`aggregate.rate()` function](/v2.0/reference/flux/stdlib/experimental/aggregate/rate/) to calculate the average rate of change per window of time. + If time between points varies, these functions normalize points to a common time interval + making values easily comparable. weight: 210 menu: v2_0: @@ -33,6 +35,8 @@ Use the [`derivative()` function](/v2.0/reference/flux/stdlib/built-in/transform to calculate the rate of change between subsequent values or the [`aggregate.rate()` function](/v2.0/reference/flux/stdlib/experimental/aggregate/rate/) to calculate the average rate of change per window of time. +If time between points varies, these functions normalize points to a common time interval +making values easily comparable. - [Rate of change between subsequent values](#rate-of-change-between-subsequent-values) - [Average rate of change per window of time](#average-rate-of-change-per-window-of-time) @@ -47,6 +51,7 @@ data ``` By default, `derivative()` returns only positive derivative values and replaces negative values with _null_. +Cacluated values are returned as [floats](/v2.0/reference/flux/language/types/#numeric-types). {{< flex >}} @@ -56,11 +61,11 @@ By default, `derivative()` returns only positive derivative values and replaces | _time | _value | |:----- | ------:| | 2020-01-01T00:00:00Z | 250 | -| 2020-01-01T00:10:00Z | 160 | -| 2020-01-01T00:20:00Z | 150 | -| 2020-01-01T00:30:00Z | 220 | -| 2020-01-01T00:40:00Z | 200 | -| 2020-01-01T00:50:00Z | 290 | +| 2020-01-01T00:04:00Z | 160 | +| 2020-01-01T00:12:00Z | 150 | +| 2020-01-01T00:19:00Z | 220 | +| 2020-01-01T00:32:00Z | 200 | +| 2020-01-01T00:51:00Z | 290 | | 2020-01-01T01:00:00Z | 340 | {{% /flex-content %}} {{% flex-content %}} @@ -68,12 +73,12 @@ By default, `derivative()` returns only positive derivative values and replaces | _time | _value | |:----- | ------:| -| 2020-01-01T00:10:00Z | | -| 2020-01-01T00:20:00Z | | -| 2020-01-01T00:30:00Z | 7 | -| 2020-01-01T00:40:00Z | | -| 2020-01-01T00:50:00Z | 9 | -| 2020-01-01T01:00:00Z | 5 | +| 2020-01-01T00:04:00Z | | +| 2020-01-01T00:12:00Z | | +| 2020-01-01T00:19:00Z | 10.0 | +| 2020-01-01T00:32:00Z | | +| 2020-01-01T00:51:00Z | 4.74 | +| 2020-01-01T01:00:00Z | 5.56 | {{% /flex-content %}} {{< /flex >}} @@ -90,11 +95,11 @@ To return negative derivative values, set the `nonNegative` parameter to `false` | _time | _value | |:----- | ------:| | 2020-01-01T00:00:00Z | 250 | -| 2020-01-01T00:10:00Z | 160 | -| 2020-01-01T00:20:00Z | 150 | -| 2020-01-01T00:30:00Z | 220 | -| 2020-01-01T00:40:00Z | 200 | -| 2020-01-01T00:50:00Z | 290 | +| 2020-01-01T00:04:00Z | 160 | +| 2020-01-01T00:12:00Z | 150 | +| 2020-01-01T00:19:00Z | 220 | +| 2020-01-01T00:32:00Z | 200 | +| 2020-01-01T00:51:00Z | 290 | | 2020-01-01T01:00:00Z | 340 | {{% /flex-content %}} {{% flex-content %}} @@ -109,12 +114,12 @@ To return negative derivative values, set the `nonNegative` parameter to `false` | _time | _value | |:----- | ------:| -| 2020-01-01T00:10:00Z | -9 | -| 2020-01-01T00:20:00Z | -1 | -| 2020-01-01T00:30:00Z | 7 | -| 2020-01-01T00:40:00Z | -2 | -| 2020-01-01T00:50:00Z | 9 | -| 2020-01-01T01:00:00Z | 5 | +| 2020-01-01T00:04:00Z | -22.5 | +| 2020-01-01T00:12:00Z | -1.25 | +| 2020-01-01T00:19:00Z | 10.0 | +| 2020-01-01T00:32:00Z | -1.54 | +| 2020-01-01T00:51:00Z | 4.74 | +| 2020-01-01T01:00:00Z | 5.56 | {{% /flex-content %}} {{< /flex >}} @@ -137,8 +142,13 @@ data ) ``` -`aggregate.rate()` returns the average rate of change per `unit` for time intervals defined by `every`. -**Negative values are replaced with _null_.** +`aggregate.rate()` returns the average rate of change (as a [float](/v2.0/reference/flux/language/types/#numeric-types)) +per `unit` for time intervals defined by `every`. +Negative values are replaced with _null_. + +{{% note %}} +`aggregate.rate()` does not support `nonNegative: false`. +{{% /note %}} {{< flex >}} {{% flex-content %}} @@ -147,11 +157,11 @@ data | _time | _value | |:----- | ------:| | 2020-01-01T00:00:00Z | 250 | -| 2020-01-01T00:10:00Z | 160 | -| 2020-01-01T00:20:00Z | 150 | -| 2020-01-01T00:30:00Z | 220 | -| 2020-01-01T00:40:00Z | 200 | -| 2020-01-01T00:50:00Z | 290 | +| 2020-01-01T00:04:00Z | 160 | +| 2020-01-01T00:12:00Z | 150 | +| 2020-01-01T00:19:00Z | 220 | +| 2020-01-01T00:32:00Z | 200 | +| 2020-01-01T00:51:00Z | 290 | | 2020-01-01T01:00:00Z | 340 | {{% /flex-content %}} {{% flex-content %}} @@ -167,9 +177,9 @@ data | _time | _value | |:----- | ------:| | 2020-01-01T00:20:00Z | | -| 2020-01-01T00:40:00Z | 7 | -| 2020-01-01T01:00:00Z | 9 | -| 2020-01-01T01:20:00Z | 5 | +| 2020-01-01T00:40:00Z | 10.0 | +| 2020-01-01T01:00:00Z | 4.74 | +| 2020-01-01T01:20:00Z | 5.56 | {{% /flex-content %}} {{< /flex >}} From aa6992b3adb4ce476d1041b0570b7bb7a9b1a158 Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Fri, 24 Apr 2020 14:53:06 -0600 Subject: [PATCH 20/23] fixed broken nav items --- .../v2.0/query-data/flux/custom-functions/custom-aggregate.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/v2.0/query-data/flux/custom-functions/custom-aggregate.md b/content/v2.0/query-data/flux/custom-functions/custom-aggregate.md index 525a66734..7796d7e4b 100644 --- a/content/v2.0/query-data/flux/custom-functions/custom-aggregate.md +++ b/content/v2.0/query-data/flux/custom-functions/custom-aggregate.md @@ -5,7 +5,7 @@ v2.0/tags: [functions, custom, flux, aggregates] menu: v2_0: name: Custom aggregate functions - parent: Create custom functions + parent: Custom functions weight: 301 aliases: - /v2.0/query-data/guides/custom-functions/custom-aggregate/ From c8d7572190bd1e29a357917e971128dc2f40c7e9 Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Fri, 24 Apr 2020 14:56:11 -0600 Subject: [PATCH 21/23] fixed typo in scalar values doc --- content/v2.0/query-data/flux/scalar-values.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/v2.0/query-data/flux/scalar-values.md b/content/v2.0/query-data/flux/scalar-values.md index d6b299867..4eca5112d 100644 --- a/content/v2.0/query-data/flux/scalar-values.md +++ b/content/v2.0/query-data/flux/scalar-values.md @@ -19,7 +19,7 @@ list_code_example: | scalarValue = { _record = data - |> tableFine(fn: key => true) + |> tableFind(fn: key => true) |> getRecord(idx: 0) return _record._value } From 57420babeffdbfaeaad68999ec1b093173be315b Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Fri, 24 Apr 2020 14:58:09 -0600 Subject: [PATCH 22/23] changed wieght of join query guide --- content/v2.0/query-data/flux/join.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/v2.0/query-data/flux/join.md b/content/v2.0/query-data/flux/join.md index 4ea34d38c..f3a8e2a7a 100644 --- a/content/v2.0/query-data/flux/join.md +++ b/content/v2.0/query-data/flux/join.md @@ -8,7 +8,7 @@ menu: v2_0: name: Join parent: Query with Flux -weight: 220 +weight: 210 aliases: - /v2.0/query-data/guides/join/ list_code_example: | From b617f6e6a356dbd42cfbc4ae350997042e8c25c0 Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Fri, 24 Apr 2020 16:26:38 -0600 Subject: [PATCH 23/23] updated related links throughout, updated geo shape data query guide --- .../v2.0/query-data/flux/conditional-logic.md | 5 +++ content/v2.0/query-data/flux/cumulativesum.md | 2 + .../flux/custom-functions/custom-aggregate.md | 4 +- content/v2.0/query-data/flux/exists.md | 5 ++- content/v2.0/query-data/flux/fill.md | 2 + content/v2.0/query-data/flux/first-last.md | 3 ++ .../query-data/flux/geo/filter-by-region.md | 3 ++ .../query-data/flux/geo/group-geo-data.md | 4 ++ .../query-data/flux/geo/shape-geo-data.md | 34 ++++++++------ content/v2.0/query-data/flux/group-data.md | 3 ++ content/v2.0/query-data/flux/histograms.md | 2 + content/v2.0/query-data/flux/increase.md | 2 + content/v2.0/query-data/flux/join.md | 2 + .../query-data/flux/manipulate-timestamps.md | 8 ++++ .../query-data/flux/mathematic-operations.md | 5 +++ content/v2.0/query-data/flux/median.md | 2 + .../v2.0/query-data/flux/monitor-states.md | 44 ++++++++++--------- .../v2.0/query-data/flux/moving-average.md | 3 ++ .../query-data/flux/percentile-quantile.md | 1 + content/v2.0/query-data/flux/query-fields.md | 4 ++ content/v2.0/query-data/flux/rate.md | 1 + .../query-data/flux/regular-expressions.md | 3 ++ content/v2.0/query-data/flux/sort-limit.md | 3 ++ content/v2.0/query-data/flux/sql.md | 4 +- .../v2.0/query-data/flux/window-aggregate.md | 5 +++ .../flux/stdlib/built-in/inputs/buckets.md | 7 +-- .../flux/stdlib/built-in/inputs/from.md | 8 ++-- .../flux/stdlib/built-in/outputs/to.md | 8 +--- .../flux/stdlib/built-in/outputs/yield.md | 7 +-- .../transformations/aggregates/_index.md | 2 + .../aggregates/aggregatewindow.md | 11 ++--- .../transformations/aggregates/count.md | 7 +-- .../transformations/aggregates/derivative.md | 8 ++-- .../transformations/aggregates/difference.md | 7 +-- .../transformations/aggregates/increase.md | 2 + .../transformations/aggregates/integral.md | 7 +-- .../transformations/aggregates/mean.md | 7 +-- .../transformations/aggregates/median.md | 8 ++-- .../transformations/aggregates/mode.md | 7 +-- .../aggregates/movingaverage.md | 1 + .../transformations/aggregates/quantile.md | 8 ++-- .../transformations/aggregates/reduce.md | 3 ++ .../transformations/aggregates/spread.md | 7 +-- .../transformations/aggregates/stddev.md | 7 +-- .../transformations/aggregates/sum.md | 7 +-- .../built-in/transformations/columns.md | 13 +++--- .../built-in/transformations/cumulativesum.md | 8 ++-- .../stdlib/built-in/transformations/drop.md | 6 --- .../stdlib/built-in/transformations/fill.md | 8 ++-- .../stdlib/built-in/transformations/filter.md | 11 +++-- .../stdlib/built-in/transformations/group.md | 8 ++-- .../built-in/transformations/histogram.md | 2 + .../stdlib/built-in/transformations/join.md | 1 + .../stdlib/built-in/transformations/keys.md | 13 +++--- .../built-in/transformations/keyvalues.md | 18 +++----- .../stdlib/built-in/transformations/limit.md | 1 + .../stdlib/built-in/transformations/map.md | 3 ++ .../stdlib/built-in/transformations/range.md | 7 +-- .../transformations/selectors/_index.md | 2 + .../transformations/selectors/bottom.md | 7 +-- .../transformations/selectors/distinct.md | 7 +-- .../transformations/selectors/first.md | 8 ++-- .../transformations/selectors/last.md | 8 ++-- .../built-in/transformations/selectors/max.md | 7 +-- .../built-in/transformations/selectors/min.md | 7 +-- .../transformations/selectors/sample.md | 7 +-- .../stdlib/built-in/transformations/sort.md | 2 + .../built-in/transformations/statecount.md | 2 + .../built-in/transformations/stateduration.md | 2 + .../transformations/stream-table/_index.md | 2 + .../transformations/stream-table/getcolumn.md | 2 + .../transformations/stream-table/getrecord.md | 2 + .../transformations/stream-table/tablefind.md | 2 + .../stdlib/built-in/transformations/window.md | 8 ++-- .../stdlib/experimental/aggregate/rate.md | 2 + .../flux/stdlib/experimental/geo/_index.md | 2 + .../flux/stdlib/experimental/geo/astracks.md | 2 + .../stdlib/experimental/geo/filterrows.md | 1 + .../stdlib/experimental/geo/gridfilter.md | 1 + .../stdlib/experimental/geo/groupbyarea.md | 2 + .../stdlib/experimental/geo/s2cellidtoken.md | 2 + .../flux/stdlib/experimental/geo/shapedata.md | 2 + .../stdlib/experimental/geo/strictfilter.md | 1 + .../flux/stdlib/experimental/geo/torows.md | 1 + .../v2.0/reference/flux/stdlib/math/_index.md | 2 + .../v2.0/reference/flux/stdlib/sql/_index.md | 2 + 86 files changed, 259 insertions(+), 218 deletions(-) diff --git a/content/v2.0/query-data/flux/conditional-logic.md b/content/v2.0/query-data/flux/conditional-logic.md index a240b1a62..537528420 100644 --- a/content/v2.0/query-data/flux/conditional-logic.md +++ b/content/v2.0/query-data/flux/conditional-logic.md @@ -13,6 +13,11 @@ menu: weight: 220 aliases: - /v2.0/query-data/guides/conditional-logic/ +related: + - /v2.0/query-data/flux/query-fields/ + - /v2.0/reference/flux/stdlib/built-in/transformations/filter/ + - /v2.0/reference/flux/stdlib/built-in/transformations/map/ + - /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/reduce/ list_code_example: | ```js if color == "green" then "008000" else "ffffff" diff --git a/content/v2.0/query-data/flux/cumulativesum.md b/content/v2.0/query-data/flux/cumulativesum.md index 52e1d56de..ec8ae1899 100644 --- a/content/v2.0/query-data/flux/cumulativesum.md +++ b/content/v2.0/query-data/flux/cumulativesum.md @@ -10,6 +10,8 @@ menu: parent: Query with Flux name: Cumulative sum v2.0/tags: [query, cumulative sum] +related: + - /v2.0/reference/flux/stdlib/built-in/transformations/cumulativesum/ list_code_example: | ```js data diff --git a/content/v2.0/query-data/flux/custom-functions/custom-aggregate.md b/content/v2.0/query-data/flux/custom-functions/custom-aggregate.md index 7796d7e4b..316444959 100644 --- a/content/v2.0/query-data/flux/custom-functions/custom-aggregate.md +++ b/content/v2.0/query-data/flux/custom-functions/custom-aggregate.md @@ -8,7 +8,9 @@ menu: parent: Custom functions weight: 301 aliases: - - /v2.0/query-data/guides/custom-functions/custom-aggregate/ + - /v2.0/query-data/guides/custom-functions/custom-aggregate/ +related: + - /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/reduce/ --- To aggregate your data, use the Flux diff --git a/content/v2.0/query-data/flux/exists.md b/content/v2.0/query-data/flux/exists.md index ee2e656a9..7a447bb8d 100644 --- a/content/v2.0/query-data/flux/exists.md +++ b/content/v2.0/query-data/flux/exists.md @@ -12,7 +12,10 @@ menu: parent: Query with Flux weight: 220 aliases: - - /v2.0/query-data/guides/exists/ + - /v2.0/query-data/guides/exists/ +related: + - /v2.0/query-data/flux/query-fields/ + - /v2.0/reference/flux/stdlib/built-in/transformations/filter/ list_code_example: | ##### Filter null values ```js diff --git a/content/v2.0/query-data/flux/fill.md b/content/v2.0/query-data/flux/fill.md index e23cf0706..bdc872696 100644 --- a/content/v2.0/query-data/flux/fill.md +++ b/content/v2.0/query-data/flux/fill.md @@ -11,6 +11,8 @@ menu: parent: Query with Flux name: Fill v2.0/tags: [query, fill] +related: + - /v2.0/reference/flux/stdlib/built-in/transformations/fill/ list_code_example: | ```js data diff --git a/content/v2.0/query-data/flux/first-last.md b/content/v2.0/query-data/flux/first-last.md index 92761363c..9e53a5318 100644 --- a/content/v2.0/query-data/flux/first-last.md +++ b/content/v2.0/query-data/flux/first-last.md @@ -12,6 +12,9 @@ menu: parent: Query with Flux name: First & last v2.0/tags: [query] +related: + - /v2.0/reference/flux/stdlib/built-in/transformations/selectors/first/ + - /v2.0/reference/flux/stdlib/built-in/transformations/selectors/last/ list_code_example: | ```js data diff --git a/content/v2.0/query-data/flux/geo/filter-by-region.md b/content/v2.0/query-data/flux/geo/filter-by-region.md index 522546af5..082408541 100644 --- a/content/v2.0/query-data/flux/geo/filter-by-region.md +++ b/content/v2.0/query-data/flux/geo/filter-by-region.md @@ -7,6 +7,9 @@ menu: name: Filter by region parent: Geo-temporal data weight: 302 +related: + - /v2.0/reference/flux/stdlib/experimental/geo/ + - /v2.0/reference/flux/stdlib/experimental/geo/filterrows/ list_code_example: | ```js import "experimental/geo" diff --git a/content/v2.0/query-data/flux/geo/group-geo-data.md b/content/v2.0/query-data/flux/geo/group-geo-data.md index d4961eef0..0f12aad5d 100644 --- a/content/v2.0/query-data/flux/geo/group-geo-data.md +++ b/content/v2.0/query-data/flux/geo/group-geo-data.md @@ -7,6 +7,10 @@ menu: v2_0: parent: Geo-temporal data weight: 302 +related: + - /v2.0/reference/flux/stdlib/experimental/geo/ + - /v2.0/reference/flux/stdlib/experimental/geo/groupbyarea/ + - /v2.0/reference/flux/stdlib/experimental/geo/astracks/ list_code_example: | ```js import "experimental/geo" diff --git a/content/v2.0/query-data/flux/geo/shape-geo-data.md b/content/v2.0/query-data/flux/geo/shape-geo-data.md index a93b81e42..d488e2ca5 100644 --- a/content/v2.0/query-data/flux/geo/shape-geo-data.md +++ b/content/v2.0/query-data/flux/geo/shape-geo-data.md @@ -8,6 +8,10 @@ menu: name: Shape geo-temporal data parent: Geo-temporal data weight: 301 +related: + - /v2.0/reference/flux/stdlib/experimental/geo/ + - /v2.0/reference/flux/stdlib/experimental/geo/shapedata/ + - /v2.0/reference/flux/stdlib/experimental/geo/s2cellidtoken/ list_code_example: | ```js import "experimental/geo" @@ -32,24 +36,23 @@ Functions in the Geo package require the following data schema: - a **`lat` field** field containing the **latitude in decimal degrees** (WGS 84) - a **`lon` field** field containing the **longitude in decimal degrees** (WGS 84) - -- [Rename latitude and longitude fields](#rename-latitude-and-longitude-fields) -- [Generate S2 cell ID tokens](#generate-s2-cell-id-tokens) - -## Rename latitude and longitude fields -Use [`map()`](/v2.0/reference/flux/stdlib/built-in/transformations/map/) to rename -existing latitude and longitude fields using other names. +## Shape geo-temporal data +If your data already contains latitude and longitude fields, use the +[`geo.shapeData()`function](/v2.0/reference/flux/stdlib/experimental/geo/shapedata/) +to rename the fields to match the requirements of the Geo package, pivot the data +into row-wise sets, and generate S2 cell ID tokens for each point. ```js +import "experimental/geo" + from(bucket: "example-bucket") |> range(start: -1h) |> filter(fn: (r) => r._measurement == "example-measurement") - |> map(fn: (r) => ({ r with - _field: - if r._field == "existingLatitudeField" then "lat" - else if r._field == "existingLongitudeField" then "lon" - else r._field - })) + |> geo.shapeData( + latField: "latitude", + lonField: "longitude", + level: 10 + ) ``` ## Generate S2 cell ID tokens @@ -119,3 +122,8 @@ from(bucket: "example-bucket") s2_cell_id: geo.s2CellIDToken(point: {lon: r.lon, lat: r.lat}, level: 10) })) ``` + +{{% note %}} +The [`geo.shapeData()`function](/v2.0/reference/flux/stdlib/experimental/geo/shapedata/) +generates S2 cell ID tokens as well. +{{% /note %}} diff --git a/content/v2.0/query-data/flux/group-data.md b/content/v2.0/query-data/flux/group-data.md index ab9ed1c5e..b8b470693 100644 --- a/content/v2.0/query-data/flux/group-data.md +++ b/content/v2.0/query-data/flux/group-data.md @@ -12,6 +12,9 @@ menu: weight: 202 aliases: - /v2.0/query-data/guides/group-data/ +related: + - /v2.0/reference/flux/stdlib/built-in/transformations/group + - /v2.0/reference/flux/stdlib/experimental/group list_code_example: | ```js data diff --git a/content/v2.0/query-data/flux/histograms.md b/content/v2.0/query-data/flux/histograms.md index 713ab0858..1a9c0cb60 100644 --- a/content/v2.0/query-data/flux/histograms.md +++ b/content/v2.0/query-data/flux/histograms.md @@ -12,6 +12,8 @@ menu: weight: 210 aliases: - /v2.0/query-data/guides/histograms/ +related: + - /v2.0/reference/flux/stdlib/built-in/transformations/histogram list_code_example: | ```js data diff --git a/content/v2.0/query-data/flux/increase.md b/content/v2.0/query-data/flux/increase.md index 1b5ff21f0..88ad2eeba 100644 --- a/content/v2.0/query-data/flux/increase.md +++ b/content/v2.0/query-data/flux/increase.md @@ -13,6 +13,8 @@ menu: parent: Query with Flux name: Increase v2.0/tags: [query, increase, counters] +related: + - /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/increase/ list_code_example: | ```js data diff --git a/content/v2.0/query-data/flux/join.md b/content/v2.0/query-data/flux/join.md index f3a8e2a7a..35002a269 100644 --- a/content/v2.0/query-data/flux/join.md +++ b/content/v2.0/query-data/flux/join.md @@ -11,6 +11,8 @@ menu: weight: 210 aliases: - /v2.0/query-data/guides/join/ +related: + - /v2.0/reference/flux/stdlib/built-in/transformations/join list_code_example: | ```js join( diff --git a/content/v2.0/query-data/flux/manipulate-timestamps.md b/content/v2.0/query-data/flux/manipulate-timestamps.md index d2f7302e2..401b98d6a 100644 --- a/content/v2.0/query-data/flux/manipulate-timestamps.md +++ b/content/v2.0/query-data/flux/manipulate-timestamps.md @@ -10,6 +10,14 @@ menu: weight: 220 aliases: - /v2.0/query-data/guides/manipulate-timestamps/ +related: + - /v2.0/reference/flux/stdlib/built-in/misc/now/ + - /v2.0/reference/flux/stdlib/system/time/ + - /v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/time/ + - /v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/uint/ + - /v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/int/ + - /v2.0/reference/flux/stdlib/experimental/addduration/ + - /v2.0/reference/flux/stdlib/experimental/subduration/ --- Every point stored in InfluxDB has an associated timestamp. diff --git a/content/v2.0/query-data/flux/mathematic-operations.md b/content/v2.0/query-data/flux/mathematic-operations.md index dc3647e27..5eee791c9 100644 --- a/content/v2.0/query-data/flux/mathematic-operations.md +++ b/content/v2.0/query-data/flux/mathematic-operations.md @@ -13,6 +13,11 @@ menu: weight: 205 aliases: - /v2.0/query-data/guides/mathematic-operations/ +related: + - /v2.0/reference/flux/stdlib/built-in/transformations/map + - /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/reduce/ + - /v2.0/reference/flux/language/operators/ + - /v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/ list_code_example: | ```js data diff --git a/content/v2.0/query-data/flux/median.md b/content/v2.0/query-data/flux/median.md index 4070b80fb..4fcd61a5f 100644 --- a/content/v2.0/query-data/flux/median.md +++ b/content/v2.0/query-data/flux/median.md @@ -13,6 +13,8 @@ menu: v2.0/tags: [query, median] related: - /v2.0/query-data/flux/percentile-quantile/ + - /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/median/ + - /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/quantile/ list_code_example: | ```js data diff --git a/content/v2.0/query-data/flux/monitor-states.md b/content/v2.0/query-data/flux/monitor-states.md index 1788b685f..4f08b48e1 100644 --- a/content/v2.0/query-data/flux/monitor-states.md +++ b/content/v2.0/query-data/flux/monitor-states.md @@ -9,7 +9,10 @@ menu: parent: Query with Flux weight: 220 aliases: - - /v2.0/query-data/guides/monitor-states/ + - /v2.0/query-data/guides/monitor-states/ +related: + - /v2.0/reference/flux/stdlib/built-in/transformations/stateduration/ + - /v2.0/reference/flux/stdlib/built-in/transformations/statecount/ --- Flux helps you monitor states in your metrics and events: @@ -33,11 +36,11 @@ If you're just getting started with Flux queries, check out the following: - **Unit:** the unit of time (`1s` (by default), `1m`, `1h`) used to increment the state duration. ```js - |> stateDuration( - fn: (r) => - r._column_to_search == "value_to_search_for", - column: "state_duration", - unit: 1s) + |> stateDuration( + fn: (r) => r._column_to_search == "value_to_search_for", + column: "state_duration", + unit: 1s + ) ``` 2. Use `stateDuration()` to search each point for the specified value: @@ -65,7 +68,7 @@ In this example, `door_closed` is the **State duration** column. If you write da Results for the example query above may look like this (for simplicity, we've omitted the measurement, tag, and field columns): -```bash +```sh _time _value door_closed 2019-10-26T17:39:16Z closed 0 2019-10-26T17:40:16Z closed 60 @@ -77,19 +80,20 @@ _time _value door_closed ## Count the number of consecutive states -1. Use the `stateCount()` function and include the following information: +1. Use the [`stateCount()` function](/v2.0/reference/flux/stdlib/built-in/transformations/statecount/) + and include the following information: - **Column to search:** any tag key, tag value, field key, field value, or measurement. - **Value:** to search for in the specified column. - - **State count column:** a new column to store the state count─the number of consecutive records in which the specified value exists. + - **State count column:** a new column to store the state count─the number of + consecutive records in which the specified value exists. ```js - |> stateCount - (fn: (r) => - r._column_to_search == "value_to_search_for", - column: "state_count"` - ) - ``` + |> stateCount( + fn: (r) => r._column_to_search == "value_to_search_for", + column: "state_count" + ) + ``` 2. Use `stateCount()` to search each point for the specified value: @@ -101,12 +105,12 @@ _time _value door_closed The following query searches the `doors` bucket over the past 5 minutes and calculates how many points have `closed` as their `_value`. ```js - from(bucket: "doors") +from(bucket: "doors") |> range(start: -5m) |> stateDuration( - fn: (r) => - r._value == "closed", - column: "door_closed") + fn: (r) => r._value == "closed", + column: "door_closed" + ) ``` This example stores the **state count** in the `door_closed` column. If you write data to the `doors` bucket every minute, the state count increases by `1` for each consecutive point where `_value` is `closed`. If `_value` is not `closed`, the state count is reset to `-1`. @@ -129,7 +133,7 @@ _time _value door_closed The following query checks the machine state every minute (idle, assigned, or busy). InfluxDB searches the `servers` bucket over the past hour and counts records with a machine state of `idle`, `assigned` or `busy`. -``` +```js from(bucket: "servers") |> range(start: -1h) |> filter(fn: (r) => diff --git a/content/v2.0/query-data/flux/moving-average.md b/content/v2.0/query-data/flux/moving-average.md index a12c3fe88..c33b07327 100644 --- a/content/v2.0/query-data/flux/moving-average.md +++ b/content/v2.0/query-data/flux/moving-average.md @@ -12,6 +12,9 @@ menu: parent: Query with Flux name: Moving Average v2.0/tags: [query, moving average] +related: + - /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/movingaverage/ + - /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/timedmovingaverage/ list_code_example: | ```js data diff --git a/content/v2.0/query-data/flux/percentile-quantile.md b/content/v2.0/query-data/flux/percentile-quantile.md index 8f8600fba..adf37d021 100644 --- a/content/v2.0/query-data/flux/percentile-quantile.md +++ b/content/v2.0/query-data/flux/percentile-quantile.md @@ -13,6 +13,7 @@ menu: v2.0/tags: [query, percentile, quantile] related: - /v2.0/query-data/flux/query-median/ + - /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/quantile/ list_code_example: | ```js data diff --git a/content/v2.0/query-data/flux/query-fields.md b/content/v2.0/query-data/flux/query-fields.md index c48ba5561..16bfd29f2 100644 --- a/content/v2.0/query-data/flux/query-fields.md +++ b/content/v2.0/query-data/flux/query-fields.md @@ -10,6 +10,10 @@ menu: v2_0: parent: Query with Flux v2.0/tags: [query, select, where] +related: + - /v2.0/reference/flux/stdlib/built-in/transformations/filter/ + - /v2.0/query-data/flux/conditional-logic/ + - /v2.0/query-data/flux/regular-expressions/ list_code_example: | ```js from(bucket: "example-bucket") diff --git a/content/v2.0/query-data/flux/rate.md b/content/v2.0/query-data/flux/rate.md index ad3f2fa9f..299fc7185 100644 --- a/content/v2.0/query-data/flux/rate.md +++ b/content/v2.0/query-data/flux/rate.md @@ -16,6 +16,7 @@ menu: name: Rate v2.0/tags: [query, rate] related: + - /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/derivative/ - /v2.0/reference/flux/stdlib/experimental/aggregate/rate/ list_code_example: | ```js diff --git a/content/v2.0/query-data/flux/regular-expressions.md b/content/v2.0/query-data/flux/regular-expressions.md index 5bf271ef2..ef72bba64 100644 --- a/content/v2.0/query-data/flux/regular-expressions.md +++ b/content/v2.0/query-data/flux/regular-expressions.md @@ -10,6 +10,9 @@ menu: weight: 220 aliases: - /v2.0/query-data/guides/regular-expressions/ +related: + - /v2.0/query-data/flux/query-fields/ + - /v2.0/reference/flux/stdlib/regexp/ list_code_example: | ```js data diff --git a/content/v2.0/query-data/flux/sort-limit.md b/content/v2.0/query-data/flux/sort-limit.md index e98455d52..7dceb31af 100644 --- a/content/v2.0/query-data/flux/sort-limit.md +++ b/content/v2.0/query-data/flux/sort-limit.md @@ -15,6 +15,9 @@ menu: weight: 203 aliases: - /v2.0/query-data/guides/sort-limit/ +related: + - /v2.0/reference/flux/stdlib/built-in/transformations/sort + - /v2.0/reference/flux/stdlib/built-in/transformations/limit list_code_example: | ```js data diff --git a/content/v2.0/query-data/flux/sql.md b/content/v2.0/query-data/flux/sql.md index 52daa5db6..b769145ff 100644 --- a/content/v2.0/query-data/flux/sql.md +++ b/content/v2.0/query-data/flux/sql.md @@ -12,7 +12,9 @@ menu: list_title: SQL data weight: 220 aliases: - - /v2.0/query-data/guides/sql/ + - /v2.0/query-data/guides/sql/ +related: + - /v2.0/reference/flux/stdlib/sql/ list_code_example: | ```js import "sql" diff --git a/content/v2.0/query-data/flux/window-aggregate.md b/content/v2.0/query-data/flux/window-aggregate.md index 9eec46972..3b9172012 100644 --- a/content/v2.0/query-data/flux/window-aggregate.md +++ b/content/v2.0/query-data/flux/window-aggregate.md @@ -13,6 +13,11 @@ weight: 204 v2.0/tags: [flux, aggregates] aliases: - /v2.0/query-data/guides/window-aggregate/ +related: + - /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/aggregatewindow + - /v2.0/reference/flux/stdlib/built-in/transformations/window + - /v2.0/reference/flux/stdlib/built-in/transformations/aggregates + - /v2.0/reference/flux/stdlib/built-in/transformations/selectors list_code_example: | ```js data diff --git a/content/v2.0/reference/flux/stdlib/built-in/inputs/buckets.md b/content/v2.0/reference/flux/stdlib/built-in/inputs/buckets.md index c759c932f..f2ca555fc 100644 --- a/content/v2.0/reference/flux/stdlib/built-in/inputs/buckets.md +++ b/content/v2.0/reference/flux/stdlib/built-in/inputs/buckets.md @@ -9,6 +9,8 @@ menu: name: buckets parent: built-in-inputs weight: 401 +related: + - https://docs.influxdata.com/influxdb/latest/query_language/schema_exploration/#show-databases, InfluxQL - SHOW DATABASES]() --- The `buckets()` function returns a list of buckets in the organization. @@ -18,8 +20,3 @@ _**Function type:** Input_ ```js buckets() ``` - -
- -##### Related InfluxQL functions and statements: -[SHOW DATABASES](https://docs.influxdata.com/influxdb/latest/query_language/schema_exploration/#show-databases) diff --git a/content/v2.0/reference/flux/stdlib/built-in/inputs/from.md b/content/v2.0/reference/flux/stdlib/built-in/inputs/from.md index 6c9cbe39a..b01bfdb7b 100644 --- a/content/v2.0/reference/flux/stdlib/built-in/inputs/from.md +++ b/content/v2.0/reference/flux/stdlib/built-in/inputs/from.md @@ -9,6 +9,8 @@ menu: name: from parent: built-in-inputs weight: 401 +related: + - https://docs.influxdata.com/influxdb/latest/query_language/data_exploration/#from-clause, InfluxQL - FROM --- The `from()` function retrieves data from an InfluxDB data source. @@ -46,8 +48,4 @@ from(bucket: "example-bucket") ```js from(bucketID: "0261d8287f4d6000") ``` - -
- -##### Related InfluxQL functions and statements: -[FROM](https://docs.influxdata.com/influxdb/latest/query_language/data_exploration/#from-clause) +[FROM]() diff --git a/content/v2.0/reference/flux/stdlib/built-in/outputs/to.md b/content/v2.0/reference/flux/stdlib/built-in/outputs/to.md index 40b28bf92..1acc8b501 100644 --- a/content/v2.0/reference/flux/stdlib/built-in/outputs/to.md +++ b/content/v2.0/reference/flux/stdlib/built-in/outputs/to.md @@ -9,6 +9,8 @@ menu: name: to parent: built-in-outputs weight: 401 +related: + - https://docs.influxdata.com/influxdb/latest/query_language/data_exploration/#the-into-clause, InfluxQL – SELECT INTO --- The `to()` function writes data to an **InfluxDB v2.0** bucket. @@ -174,9 +176,3 @@ _tag1=a hum=55.3,temp=100.1 0005 _tag1=a hum=55.4,temp=99.3 0006 _tag1=a hum=55.5,temp=99.9 0007 ``` - -
- -##### Related InfluxQL functions and statements: - -[SELECT INTO](https://docs.influxdata.com/influxdb/latest/query_language/data_exploration/#the-into-clause) diff --git a/content/v2.0/reference/flux/stdlib/built-in/outputs/yield.md b/content/v2.0/reference/flux/stdlib/built-in/outputs/yield.md index 8a736af63..16a1b23f9 100644 --- a/content/v2.0/reference/flux/stdlib/built-in/outputs/yield.md +++ b/content/v2.0/reference/flux/stdlib/built-in/outputs/yield.md @@ -9,6 +9,8 @@ menu: name: yield parent: built-in-outputs weight: 401 +related: + - https://docs.influxdata.com/influxdb/latest/query_language/data_exploration/#the-basic-select-statement, InfluxQL – SELECT AS --- The `yield()` function indicates the input tables received should be delivered as a result of the query. @@ -41,8 +43,3 @@ from(bucket: "example-bucket") |> range(start: -5m) |> yield(name: "1") ``` - -
- -##### Related InfluxQL functions and statements: -[SELECT AS](https://docs.influxdata.com/influxdb/latest/query_language/data_exploration/#the-basic-select-statement) diff --git a/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/_index.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/_index.md index b14244358..30f6441f4 100644 --- a/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/_index.md +++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/_index.md @@ -12,6 +12,8 @@ menu: identifier: built-in-aggregates weight: 401 v2.0/tags: [aggregates, built-in, functions] +related: + - /v2.0/query-data/flux/window-aggregate/ --- Flux's built-in aggregate functions take values from an input table and aggregate them in some way. diff --git a/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/aggregatewindow.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/aggregatewindow.md index ce15d9685..c26425fb6 100644 --- a/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/aggregatewindow.md +++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/aggregatewindow.md @@ -9,6 +9,10 @@ menu: name: aggregateWindow parent: built-in-aggregates weight: 501 +related: + - /v2.0/query-data/flux/window-aggregate/ + - https://docs.influxdata.com/influxdb/latest/query_language/functions/#aggregations – InfluxQL – Aggregate functions + - https://docs.influxdata.com/influxdb/latest/query_language/data_exploration/#the-group-by-clause – InfluxQL – GROUP BY time() --- The `aggregateWindow()` function applies an aggregate or selector function @@ -129,10 +133,3 @@ aggregateWindow = (every, fn, column="_value", timeSrc="_stop", timeDst="_time", |> duplicate(column:timeSrc, as:timeDst) |> window(every:inf, timeColumn:timeDst) ``` - -
- -##### Related InfluxQL functions and statements: - -[InfluxQL aggregate functions](https://docs.influxdata.com/influxdb/latest/query_language/functions/#aggregations) -[GROUP BY time()](https://docs.influxdata.com/influxdb/latest/query_language/data_exploration/#the-group-by-clause) diff --git a/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/count.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/count.md index 1b3de1af6..856079ef2 100644 --- a/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/count.md +++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/count.md @@ -9,6 +9,8 @@ menu: name: count parent: built-in-aggregates weight: 501 +related: + - https://docs.influxdata.com/influxdb/latest/query_language/functions/#count, InfluxQL – COUNT() --- The `count()` function outputs the number of records in a column. @@ -53,8 +55,3 @@ from(bucket: "example-bucket") |> range(start: -5m) |> count(column: "_value") ``` - -
- -##### Related InfluxQL functions and statements: -[COUNT()](https://docs.influxdata.com/influxdb/latest/query_language/functions/#count) diff --git a/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/derivative.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/derivative.md index e6ab8db9a..8594c0310 100644 --- a/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/derivative.md +++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/derivative.md @@ -9,6 +9,9 @@ menu: name: derivative parent: built-in-aggregates weight: 501 +related: + - /v2.0/query-data/flux/rate/ + - https://docs.influxdata.com/influxdb/latest/query_language/functions/#derivative, InfluxQL – DERIVATIVE() --- The `derivative()` function computes the rate of change per [`unit`](#unit) of time between subsequent non-null records. @@ -59,8 +62,3 @@ from(bucket: "example-bucket") |> range(start: -5m) |> derivative(unit: 1s, nonNegative: true) ``` - -
- -##### Related InfluxQL functions and statements: -[DERIVATIVE()](https://docs.influxdata.com/influxdb/latest/query_language/functions/#derivative) diff --git a/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/difference.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/difference.md index 45179da67..fb773a363 100644 --- a/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/difference.md +++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/difference.md @@ -9,6 +9,8 @@ menu: name: difference parent: built-in-aggregates weight: 501 +related: + - https://docs.influxdata.com/influxdb/latest/query_language/functions/#difference, InfluxQL – DIFFERENCE() --- The `difference()` function computes the difference between subsequent records. @@ -115,8 +117,3 @@ from(bucket: "example-bucket") | 0003 | -2 | tv | | 0004 | 6 | tv | | 0005 | null | tv | - -
- -##### Related InfluxQL functions and statements: -[DIFFERENCE()](https://docs.influxdata.com/influxdb/latest/query_language/functions/#difference) diff --git a/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/increase.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/increase.md index cfb8afb87..c1eba9af5 100644 --- a/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/increase.md +++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/increase.md @@ -11,6 +11,8 @@ menu: name: increase parent: built-in-aggregates weight: 501 +related: + - /v2.0/query-data/flux/increase/ --- The `increase()` function calculates the cumulative sum of **non-negative** differences diff --git a/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/integral.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/integral.md index c3593844f..ac85bee78 100644 --- a/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/integral.md +++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/integral.md @@ -9,6 +9,8 @@ menu: name: integral parent: built-in-aggregates weight: 501 +related: + - https://docs.influxdata.com/influxdb/latest/query_language/functions/#integral, InfluxQL – INTEGRAL() --- The `integral()` function computes the area under the curve per [`unit`](#unit) of time of subsequent non-null records. @@ -44,8 +46,3 @@ from(bucket: "example-bucket") ) |> integral(unit:10s) ``` - -
- -##### Related InfluxQL functions and statements: -[INTEGRAL()](https://docs.influxdata.com/influxdb/latest/query_language/functions/#integral) diff --git a/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/mean.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/mean.md index 6065bdadc..79c9d42aa 100644 --- a/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/mean.md +++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/mean.md @@ -9,6 +9,8 @@ menu: name: mean parent: built-in-aggregates weight: 501 +related: + - https://docs.influxdata.com/influxdb/latest/query_language/functions/#mean, InfluxQL – MEAN() --- The `mean()` function computes the mean or average of non-null records in the input table. @@ -38,8 +40,3 @@ from(bucket:"example-bucket") |> window(every:10m) |> mean() ``` - -
- -##### Related InfluxQL functions and statements: -[MEAN()](https://docs.influxdata.com/influxdb/latest/query_language/functions/#mean) diff --git a/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/median.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/median.md index 271ca394f..22b751b80 100644 --- a/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/median.md +++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/median.md @@ -11,6 +11,9 @@ menu: name: median parent: built-in-aggregates weight: 501 +related: + - /v2.0/query-data/flux/median/ + - https://docs.influxdata.com/influxdb/latest/query_language/functions/#median, InfluxQL – MEDIAN() --- The `median()` function is a special application of the [`quantile()` function](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/quantile) @@ -110,8 +113,3 @@ median = (method="estimate_tdigest", compression=0.0, tables=<-) => compression:compression ) ``` - -
- -##### Related InfluxQL functions and statements: -[MEDIAN()](https://docs.influxdata.com/influxdb/latest/query_language/functions/#median) diff --git a/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/mode.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/mode.md index 8afdee34e..c07992cf5 100644 --- a/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/mode.md +++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/mode.md @@ -10,6 +10,8 @@ menu: name: mode parent: built-in-aggregates weight: 501 +related: + - https://docs.influxdata.com/influxdb/latest/query_language/functions/#mode, InfluxQL – MODE() --- The `mode()` function computes the mode or value that occurs most often in a @@ -55,8 +57,3 @@ from(bucket: "example-bucket") |> window(every:10m) |> mode() ``` - -
- -##### Related InfluxQL functions and statements: -[MODE()](https://docs.influxdata.com/influxdb/latest/query_language/functions/#mode) diff --git a/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/movingaverage.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/movingaverage.md index 7daeee63c..cd8f97020 100644 --- a/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/movingaverage.md +++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/movingaverage.md @@ -10,6 +10,7 @@ menu: parent: built-in-aggregates weight: 501 related: + - /v2.0/query-data/flux/moving-average/ - /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/ diff --git a/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/quantile.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/quantile.md index 483455487..6b159898b 100644 --- a/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/quantile.md +++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/quantile.md @@ -10,6 +10,9 @@ menu: name: quantile parent: built-in-aggregates weight: 501 +related: + - /v2.0/query-data/flux/percentile-quantile/ + - https://docs.influxdata.com/influxdb/latest/query_language/functions/#percentile, InfluxQL – PERCENTILE() --- The `quantile()` function returns records from an input table with `_value`s that fall within @@ -99,8 +102,3 @@ from(bucket: "example-bucket") method: "exact_selector" ) ``` - -
- -##### Related InfluxQL functions and statements: -[PERCENTILE()](https://docs.influxdata.com/influxdb/latest/query_language/functions/#percentile) diff --git a/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/reduce.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/reduce.md index 72f453a62..940752e6f 100644 --- a/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/reduce.md +++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/reduce.md @@ -11,6 +11,9 @@ menu: parent: built-in-aggregates weight: 501 v2.0/tags: [exists] +related: + - /v2.0/query-data/flux/custom-functions/custom-aggregate/ + - /v2.0/query-data/flux/conditional-logic/ --- The `reduce()` function aggregates records in each table according to the reducer, diff --git a/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/spread.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/spread.md index b0ca55f65..9b0e76e8c 100644 --- a/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/spread.md +++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/spread.md @@ -9,6 +9,8 @@ menu: name: spread parent: built-in-aggregates weight: 501 +related: + - https://docs.influxdata.com/influxdb/latest/query_language/functions/#spread, InfluxQL – SPREAD() --- The `spread()` function outputs the difference between the minimum and maximum values in a specified column. @@ -42,8 +44,3 @@ from(bucket: "example-bucket") ) |> spread() ``` - -
- -##### Related InfluxQL functions and statements: -[SPREAD()](https://docs.influxdata.com/influxdb/latest/query_language/functions/#spread) diff --git a/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/stddev.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/stddev.md index 027bb214f..01921c475 100644 --- a/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/stddev.md +++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/stddev.md @@ -9,6 +9,8 @@ menu: name: stddev parent: built-in-aggregates weight: 501 +related: + - https://docs.influxdata.com/influxdb/latest/query_language/functions/#stddev, InfluxQL – STDDEV() --- The `stddev()` function computes the standard deviation of non-null records in a specified column. @@ -55,8 +57,3 @@ from(bucket: "example-bucket") ) |> stddev() ``` - -
- -##### Related InfluxQL functions and statements: -[STDDEV()](https://docs.influxdata.com/influxdb/latest/query_language/functions/#stddev) diff --git a/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/sum.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/sum.md index 15b614462..e835ffd53 100644 --- a/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/sum.md +++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/sum.md @@ -9,6 +9,8 @@ menu: name: sum parent: built-in-aggregates weight: 501 +related: + - https://docs.influxdata.com/influxdb/latest/query_language/functions/#sum, InfluxQL – SUM() --- The `sum()` function computes the sum of non-null records in a specified column. @@ -38,8 +40,3 @@ from(bucket: "example-bucket") ) |> sum() ``` - -
- -##### Related InfluxQL functions and statements: -[SUM()](https://docs.influxdata.com/influxdb/latest/query_language/functions/#sum) diff --git a/content/v2.0/reference/flux/stdlib/built-in/transformations/columns.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/columns.md index 2703ce387..9bd20c876 100644 --- a/content/v2.0/reference/flux/stdlib/built-in/transformations/columns.md +++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/columns.md @@ -12,6 +12,11 @@ menu: name: columns parent: built-in-transformations weight: 401 +related: + - https://docs.influxdata.com/influxdb/latest/query_language/schema_exploration/#show-measurements, InfluxQL – SHOW MEASUREMENTS + - https://docs.influxdata.com/influxdb/latest/query_language/schema_exploration/#show-field-keys, InfluxQL – SHOW FIELD KEYS + - https://docs.influxdata.com/influxdb/latest/query_language/schema_exploration/#show-tag-keys, InfluxQL – SHOW TAG KEYS + - https://docs.influxdata.com/influxdb/latest/query_language/schema_exploration/#show-tag-keys, InfluxQL – SHOW SERIES --- The `columns()` function lists the column labels of input tables. @@ -50,11 +55,3 @@ from(bucket: "example-bucket") |> group() |> distinct() ``` - -
- -##### Related InfluxQL functions and statements: -[SHOW MEASUREMENTS](https://docs.influxdata.com/influxdb/latest/query_language/schema_exploration/#show-measurements) -[SHOW FIELD KEYS](https://docs.influxdata.com/influxdb/latest/query_language/schema_exploration/#show-field-keys) -[SHOW TAG KEYS](https://docs.influxdata.com/influxdb/latest/query_language/schema_exploration/#show-tag-keys) -[SHOW SERIES](https://docs.influxdata.com/influxdb/latest/query_language/schema_exploration/#show-tag-keys) diff --git a/content/v2.0/reference/flux/stdlib/built-in/transformations/cumulativesum.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/cumulativesum.md index 72d4087e6..1def460fe 100644 --- a/content/v2.0/reference/flux/stdlib/built-in/transformations/cumulativesum.md +++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/cumulativesum.md @@ -9,6 +9,9 @@ menu: name: cumulativeSum parent: built-in-transformations weight: 401 +related: + - /v2.0/query-data/flux/cumulativesum/ + - https://docs.influxdata.com/influxdb/latest/query_language/functions/#cumulative-sum, InfluxQL – CUMULATIVE_SUM() --- The `cumulativeSum()` function computes a running sum for non-null records in the table. @@ -39,8 +42,3 @@ from(bucket: "example-bucket") ) |> cumulativeSum(columns: ["_value"]) ``` - -
- -##### Related InfluxQL functions and statements: -[CUMULATIVE_SUM()](https://docs.influxdata.com/influxdb/latest/query_language/functions/#cumulative-sum) diff --git a/content/v2.0/reference/flux/stdlib/built-in/transformations/drop.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/drop.md index 2c2f70133..75a5e90bb 100644 --- a/content/v2.0/reference/flux/stdlib/built-in/transformations/drop.md +++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/drop.md @@ -65,9 +65,3 @@ from(bucket: "example-bucket") |> range(start: -5m) |> drop(fn: (column) => column =~ /usage*/) ``` - -
- -##### Related InfluxQL functions and statements: - -[DROP MEASUREMENT](https://docs.influxdata.com/influxdb/latest/query_language/database_management/#delete-measurements-with-drop-measurement) diff --git a/content/v2.0/reference/flux/stdlib/built-in/transformations/fill.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/fill.md index 9cd01d630..a0997656f 100644 --- a/content/v2.0/reference/flux/stdlib/built-in/transformations/fill.md +++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/fill.md @@ -9,6 +9,9 @@ menu: name: fill parent: built-in-transformations weight: 401 +related: + - /v2.0/query-data/flux/fill/ + - https://docs.influxdata.com/influxdb/latest/query_language/data_exploration/#group-by-time-intervals-and-fill, InfluxQL – FILL --- The `fill()` function replaces all null values in an input stream with a non-null value. @@ -70,8 +73,3 @@ from(bucket: "example-bucket") ) |> fill(usePrevious: true) ``` - -
- -##### Related InfluxQL functions and statements: -[FILL](https://docs.influxdata.com/influxdb/latest/query_language/data_exploration/#group-by-time-intervals-and-fill) diff --git a/content/v2.0/reference/flux/stdlib/built-in/transformations/filter.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/filter.md index 6f16a5c6e..5826b2023 100644 --- a/content/v2.0/reference/flux/stdlib/built-in/transformations/filter.md +++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/filter.md @@ -10,6 +10,11 @@ menu: parent: built-in-transformations weight: 401 v2.0/tags: [exists] +related: + - /v2.0/query-data/flux/query-fields/ + - /v2.0/query-data/flux/conditional-logic/ + - /v2.0/query-data/flux/exists/ + - https://docs.influxdata.com/influxdb/latest/query_language/data_exploration/#the-basic-select-statement, InfluxQL – SELECT --- The `filter()` function filters data based on conditions defined in a predicate function ([`fn`](#fn)). @@ -99,9 +104,3 @@ from(bucket: "example-bucket") |> filter(fn: (r) => r._measurement == "events" and r._field == "open") |> filter(fn: (r) => r.doorId =~ /^2.*/, onEmpty: "keep") ``` - -
- -##### Related InfluxQL functions and statements: - -[SELECT](https://docs.influxdata.com/influxdb/latest/query_language/data_exploration/#the-basic-select-statement) diff --git a/content/v2.0/reference/flux/stdlib/built-in/transformations/group.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/group.md index f968ed990..e0201f821 100644 --- a/content/v2.0/reference/flux/stdlib/built-in/transformations/group.md +++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/group.md @@ -9,6 +9,9 @@ menu: name: group parent: built-in-transformations weight: 401 +related: + - /v2.0/query-data/flux/group-data/ + - https://docs.influxdata.com/influxdb/latest/query_language/data_exploration/#the-group-by-clause, InfluxQL – GROUP BY --- The `group()` function groups records based on their values for specific columns. @@ -78,8 +81,3 @@ from(bucket: "example-bucket") |> range(start: -30m) |> group() ``` - -
- -##### Related InfluxQL functions and statements: -[GROUP BY](https://docs.influxdata.com/influxdb/latest/query_language/data_exploration/#the-group-by-clause) _(similar but different)_ diff --git a/content/v2.0/reference/flux/stdlib/built-in/transformations/histogram.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/histogram.md index a4e04bb96..cf0b839d5 100644 --- a/content/v2.0/reference/flux/stdlib/built-in/transformations/histogram.md +++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/histogram.md @@ -9,6 +9,8 @@ menu: name: histogram parent: built-in-transformations weight: 401 +related: + - /v2.0/query-data/flux/histograms/ --- The `histogram()` function approximates the cumulative distribution of a dataset by counting data frequencies for a list of bins. diff --git a/content/v2.0/reference/flux/stdlib/built-in/transformations/join.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/join.md index b9ce02ff4..5d65d942a 100644 --- a/content/v2.0/reference/flux/stdlib/built-in/transformations/join.md +++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/join.md @@ -10,6 +10,7 @@ menu: parent: built-in-transformations weight: 401 related: + - /v2.0/query-data/flux/join/ - /v2.0/reference/flux/stdlib/built-in/transformations/union/ --- diff --git a/content/v2.0/reference/flux/stdlib/built-in/transformations/keys.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/keys.md index 5f82e10b3..21a34feb6 100644 --- a/content/v2.0/reference/flux/stdlib/built-in/transformations/keys.md +++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/keys.md @@ -12,6 +12,11 @@ menu: name: keys parent: built-in-transformations weight: 401 +related: + - https://docs.influxdata.com/influxdb/latest/query_language/schema_exploration/#show-measurements, InfluxQL – SHOW MEASUREMENTS + - https://docs.influxdata.com/influxdb/latest/query_language/schema_exploration/#show-field-keys, InfluxQL – SHOW FIELD KEYS + - https://docs.influxdata.com/influxdb/latest/query_language/schema_exploration/#show-tag-keys, InfluxQL – SHOW TAG KEYS + - https://docs.influxdata.com/influxdb/latest/query_language/schema_exploration/#show-tag-keys, InfluxQL – SHOW SERIES --- The `keys()` function outputs the group key of input tables. @@ -50,11 +55,3 @@ from(bucket: "example-bucket") |> group() |> distinct() ``` - -
- -##### Related InfluxQL functions and statements: -[SHOW MEASUREMENTS](https://docs.influxdata.com/influxdb/latest/query_language/schema_exploration/#show-measurements) -[SHOW FIELD KEYS](https://docs.influxdata.com/influxdb/latest/query_language/schema_exploration/#show-field-keys) -[SHOW TAG KEYS](https://docs.influxdata.com/influxdb/latest/query_language/schema_exploration/#show-tag-keys) -[SHOW SERIES](https://docs.influxdata.com/influxdb/latest/query_language/schema_exploration/#show-tag-keys) diff --git a/content/v2.0/reference/flux/stdlib/built-in/transformations/keyvalues.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/keyvalues.md index 3db7044bc..0dafff28e 100644 --- a/content/v2.0/reference/flux/stdlib/built-in/transformations/keyvalues.md +++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/keyvalues.md @@ -9,6 +9,12 @@ menu: name: keyValues parent: built-in-transformations weight: 401 +related: + - https://docs.influxdata.com/influxdb/latest/query_language/schema_exploration/#show-measurements, InfluxQL – SHOW MEASUREMENTS + - https://docs.influxdata.com/influxdb/latest/query_language/schema_exploration/#show-field-keys, InfluxQL – SHOW FIELD KEYS + - https://docs.influxdata.com/influxdb/latest/query_language/schema_exploration/#show-tag-keys, InfluxQL – SHOW TAG KEYS + - https://docs.influxdata.com/influxdb/latest/query_language/schema_exploration/#show-tag-values, InfluxQL – SHOW TAG VALUES + - https://docs.influxdata.com/influxdb/latest/query_language/schema_exploration/#show-serie, InfluxQL – SHOW SERIES --- The `keyValues()` function returns a table with the input table's group key plus two columns, @@ -74,14 +80,4 @@ from(bucket: "example-bucket") |> range(start: -30m) |> filter(fn: (r) => r._measurement == "cpu") |> keyValues(fn: (schema) => schema.columns |> filter(fn: (r) => r.label =~ /usage_.*/)) -``` - -
- -##### Related InfluxQL functions and statements: - -[SHOW MEASUREMENTS](https://docs.influxdata.com/influxdb/latest/query_language/schema_exploration/#show-measurements) -[SHOW FIELD KEYS](https://docs.influxdata.com/influxdb/latest/query_language/schema_exploration/#show-field-keys) -[SHOW TAG KEYS](https://docs.influxdata.com/influxdb/latest/query_language/schema_exploration/#show-tag-keys) -[SHOW TAG VALUES](https://docs.influxdata.com/influxdb/latest/query_language/schema_exploration/#show-tag-values) -[SHOW SERIES](https://docs.influxdata.com/influxdb/latest/query_language/schema_exploration/#show-series) +``` diff --git a/content/v2.0/reference/flux/stdlib/built-in/transformations/limit.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/limit.md index dd7915862..6fb5f9db1 100644 --- a/content/v2.0/reference/flux/stdlib/built-in/transformations/limit.md +++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/limit.md @@ -10,6 +10,7 @@ menu: parent: built-in-transformations weight: 401 related: + - /v2.0/query-data/flux/sort-limit/ - /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 --- diff --git a/content/v2.0/reference/flux/stdlib/built-in/transformations/map.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/map.md index b5327c361..dfe4dd628 100644 --- a/content/v2.0/reference/flux/stdlib/built-in/transformations/map.md +++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/map.md @@ -10,6 +10,9 @@ menu: parent: built-in-transformations weight: 401 v2.0/tags: [exists] +related: + - /v2.0/query-data/flux/conditional-logic/ + - /v2.0/query-data/flux/mathematic-operations/ --- The `map()` function applies a function to each record in the input tables. diff --git a/content/v2.0/reference/flux/stdlib/built-in/transformations/range.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/range.md index 56d467646..1a6ad098f 100644 --- a/content/v2.0/reference/flux/stdlib/built-in/transformations/range.md +++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/range.md @@ -9,6 +9,8 @@ menu: name: range parent: built-in-transformations weight: 401 +related: + - https://docs.influxdata.com/influxdb/latest/query_language/data_exploration/#the-where-clause, InfluxQL – WHERE --- The `range()` function filters records based on time bounds. @@ -71,8 +73,3 @@ from(bucket:"example-bucket") |> range(start:2018-05-22T23:30:00Z, stop: 2018-05-23T00:00:00Z) // ... ``` - -
- -##### Related InfluxQL functions and statements: -[WHERE](https://docs.influxdata.com/influxdb/latest/query_language/data_exploration/#the-where-clause) diff --git a/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/_index.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/_index.md index 62cbf6955..4e6cc6609 100644 --- a/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/_index.md +++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/_index.md @@ -12,6 +12,8 @@ menu: identifier: built-in-selectors weight: 401 v2.0/tags: [selectors, built-in, functions] +related: + - /v2.0/query-data/flux/window-aggregate/ --- Flux's built-in selector functions return one or more records based on function logic. diff --git a/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/bottom.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/bottom.md index cb50c166e..feee2b2c1 100644 --- a/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/bottom.md +++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/bottom.md @@ -9,6 +9,8 @@ menu: name: bottom parent: built-in-selectors weight: 501 +related: + - https://docs.influxdata.com/influxdb/latest/query_language/functions/#bottom, InfluxQL – BOTTOM() --- The `bottom()` function sorts a table by columns and keeps only the bottom `n` records. @@ -56,8 +58,3 @@ _sortLimit = (n, desc, columns=["_value"], tables=<-) => bottom = (n, columns=["_value"], tables=<-) => _sortLimit(n:n, columns:columns, desc:false) ``` - -
- -##### Related InfluxQL functions and statements: -[BOTTOM()](https://docs.influxdata.com/influxdb/latest/query_language/functions/#bottom) diff --git a/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/distinct.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/distinct.md index a999c3dca..b1ea29c68 100644 --- a/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/distinct.md +++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/distinct.md @@ -9,6 +9,8 @@ menu: name: distinct parent: built-in-selectors weight: 501 +related: + - https://docs.influxdata.com/influxdb/latest/query_language/functions/#distinct, InfluxQL – DISTINCT() --- The `distinct()` function returns the unique values for a given column. @@ -36,8 +38,3 @@ from(bucket: "example-bucket") |> filter(fn: (r) => r._measurement == "cpu") |> distinct(column: "host") ``` - -
- -##### Related InfluxQL functions and statements: -[DISTINCT()](https://docs.influxdata.com/influxdb/latest/query_language/functions/#distinct) diff --git a/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/first.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/first.md index b2d80c8fd..427d5a54a 100644 --- a/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/first.md +++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/first.md @@ -9,6 +9,9 @@ menu: name: first parent: built-in-selectors weight: 501 +related: + - /v2.0/query-data/flux/first-last/ + - https://docs.influxdata.com/influxdb/latest/query_language/functions/#first, InfluxQL – FIRST() --- The `first()` function selects the first non-null record from an input table. @@ -30,8 +33,3 @@ from(bucket:"example-bucket") ) |> first() ``` - -
- -##### Related InfluxQL functions and statements: -[FIRST()](https://docs.influxdata.com/influxdb/latest/query_language/functions/#first) diff --git a/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/last.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/last.md index 52a11a4aa..4f370060f 100644 --- a/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/last.md +++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/last.md @@ -9,6 +9,9 @@ menu: name: last parent: built-in-selectors weight: 501 +related: + - /v2.0/query-data/flux/first-last/ + - https://docs.influxdata.com/influxdb/latest/query_language/functions/#last, InfluxQL – LAST() --- The `last()` function selects the last non-null record from an input table. @@ -30,8 +33,3 @@ from(bucket:"example-bucket") ) |> last() ``` - -
- -##### Related InfluxQL functions and statements: -[LAST()](https://docs.influxdata.com/influxdb/latest/query_language/functions/#last) diff --git a/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/max.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/max.md index 9ec939844..0c7956566 100644 --- a/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/max.md +++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/max.md @@ -9,6 +9,8 @@ menu: name: max parent: built-in-selectors weight: 501 +related: + - https://docs.influxdata.com/influxdb/latest/query_language/functions/#max, InfluxQL – MAX() --- The `max()` function selects record with the highest `_value` from the input table. @@ -38,8 +40,3 @@ from(bucket:"example-bucket") ) |> max() ``` - -
- -##### Related InfluxQL functions and statements: -[MAX()](https://docs.influxdata.com/influxdb/latest/query_language/functions/#max) diff --git a/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/min.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/min.md index 28c3ba794..63a7bf673 100644 --- a/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/min.md +++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/min.md @@ -9,6 +9,8 @@ menu: name: min parent: built-in-selectors weight: 501 +related: + - https://docs.influxdata.com/influxdb/latest/query_language/functions/#min, InfluxQL – MIN() --- The `min()` function selects record with the lowest `_value` from the input table. @@ -38,8 +40,3 @@ from(bucket:"example-bucket") ) |> min() ``` - -
- -##### Related InfluxQL functions and statements: -[MIN()](https://docs.influxdata.com/influxdb/latest/query_language/functions/#min) diff --git a/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/sample.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/sample.md index 7e6f9a7f5..acb8fd9d0 100644 --- a/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/sample.md +++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/sample.md @@ -9,6 +9,8 @@ menu: name: sample parent: built-in-selectors weight: 501 +related: + - https://docs.influxdata.com/influxdb/latest/query_language/functions/#sample, InfluxQL – SAMPLE() --- The `sample()` function selects a subset of the records from the input table. @@ -45,8 +47,3 @@ from(bucket:"example-bucket") ) |> sample(n: 5, pos: 1) ``` - -
- -##### Related InfluxQL functions and statements: -[SAMPLE()](https://docs.influxdata.com/influxdb/latest/query_language/functions/#sample) diff --git a/content/v2.0/reference/flux/stdlib/built-in/transformations/sort.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/sort.md index a4a6f4e1d..9c64201b4 100644 --- a/content/v2.0/reference/flux/stdlib/built-in/transformations/sort.md +++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/sort.md @@ -9,6 +9,8 @@ menu: name: sort parent: built-in-transformations weight: 401 +related: + - /v2.0/query-data/flux/sort-limit/ --- The `sort()` function orders the records within each table. diff --git a/content/v2.0/reference/flux/stdlib/built-in/transformations/statecount.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/statecount.md index 58966ae86..2b2e83ca7 100644 --- a/content/v2.0/reference/flux/stdlib/built-in/transformations/statecount.md +++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/statecount.md @@ -9,6 +9,8 @@ menu: name: stateCount parent: built-in-transformations weight: 401 +related: + - /v2.0/query-data/flux/monitor-states/ --- The `stateCount()` function computes the number of consecutive records in a given state. diff --git a/content/v2.0/reference/flux/stdlib/built-in/transformations/stateduration.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/stateduration.md index fb62eb1d8..f46f7ef13 100644 --- a/content/v2.0/reference/flux/stdlib/built-in/transformations/stateduration.md +++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/stateduration.md @@ -9,6 +9,8 @@ menu: name: stateDuration parent: built-in-transformations weight: 401 +related: + - /v2.0/query-data/flux/monitor-states/ --- The `stateDuration()` function computes the duration of a given state. diff --git a/content/v2.0/reference/flux/stdlib/built-in/transformations/stream-table/_index.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/stream-table/_index.md index c1c0f1382..688684818 100644 --- a/content/v2.0/reference/flux/stdlib/built-in/transformations/stream-table/_index.md +++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/stream-table/_index.md @@ -13,6 +13,8 @@ menu: name: Stream & table parent: built-in-transformations v2.0/tags: [transformations, built-in, functions, stream, table] +related: + - /v2.0/query-data/flux/scalar-values/ --- Use stream and table functions to extract a table from a stream of tables and access its diff --git a/content/v2.0/reference/flux/stdlib/built-in/transformations/stream-table/getcolumn.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/stream-table/getcolumn.md index cbc976099..0eb8864ac 100644 --- a/content/v2.0/reference/flux/stdlib/built-in/transformations/stream-table/getcolumn.md +++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/stream-table/getcolumn.md @@ -10,6 +10,8 @@ menu: name: getColumn parent: Stream & table weight: 501 +related: + - /v2.0/query-data/flux/scalar-values/ --- The `getColumn()` function extracts a column from a table given its label. diff --git a/content/v2.0/reference/flux/stdlib/built-in/transformations/stream-table/getrecord.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/stream-table/getrecord.md index f660be331..6aa31318f 100644 --- a/content/v2.0/reference/flux/stdlib/built-in/transformations/stream-table/getrecord.md +++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/stream-table/getrecord.md @@ -10,6 +10,8 @@ menu: name: getRecord parent: Stream & table weight: 501 +related: + - /v2.0/query-data/flux/scalar-values/ --- The `getRecord()` function extracts a record from a table given the record's index. diff --git a/content/v2.0/reference/flux/stdlib/built-in/transformations/stream-table/tablefind.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/stream-table/tablefind.md index 409ea3dbc..14c5c8519 100644 --- a/content/v2.0/reference/flux/stdlib/built-in/transformations/stream-table/tablefind.md +++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/stream-table/tablefind.md @@ -10,6 +10,8 @@ menu: name: tableFind parent: Stream & table weight: 501 +related: + - /v2.0/query-data/flux/scalar-values/ --- The `tableFind()` function extracts the first table in a stream of tables whose diff --git a/content/v2.0/reference/flux/stdlib/built-in/transformations/window.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/window.md index 6611b35a6..9c72e0b1b 100644 --- a/content/v2.0/reference/flux/stdlib/built-in/transformations/window.md +++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/window.md @@ -9,6 +9,9 @@ menu: name: window parent: built-in-transformations weight: 401 +related: + - /v2.0/query-data/flux/window-aggregate/ + - https://docs.influxdata.com/influxdb/latest/query_language/data_exploration/#the-group-by-clause, InfluxQL – GROUP BY time() --- The `window()` function groups records based on a time value. @@ -127,8 +130,3 @@ from(bucket:"example-bucket") |> range(start:-12h) |> window(intervals: intervals(every:1d, period:8h, offset:9h)) ``` - -
- -##### Related InfluxQL functions and statements: -[GROUP BY time()](https://docs.influxdata.com/influxdb/latest/query_language/data_exploration/#the-group-by-clause) diff --git a/content/v2.0/reference/flux/stdlib/experimental/aggregate/rate.md b/content/v2.0/reference/flux/stdlib/experimental/aggregate/rate.md index 88e395ab9..95ba3ac07 100644 --- a/content/v2.0/reference/flux/stdlib/experimental/aggregate/rate.md +++ b/content/v2.0/reference/flux/stdlib/experimental/aggregate/rate.md @@ -7,6 +7,8 @@ menu: name: aggregate.rate parent: Aggregate weight: 301 +related: + - /v2.0/query-data/flux/rate/ --- The `aggregate.rate()` function calculates the rate of change per windows of time. diff --git a/content/v2.0/reference/flux/stdlib/experimental/geo/_index.md b/content/v2.0/reference/flux/stdlib/experimental/geo/_index.md index a95256013..e1d1986e0 100644 --- a/content/v2.0/reference/flux/stdlib/experimental/geo/_index.md +++ b/content/v2.0/reference/flux/stdlib/experimental/geo/_index.md @@ -11,6 +11,8 @@ menu: parent: Experimental weight: 301 v2.0/tags: [functions, package, geo] +related: + - /v2.0/query-data/flux/geo/ --- The Flux Geo package provides tools for working with geo-temporal data, diff --git a/content/v2.0/reference/flux/stdlib/experimental/geo/astracks.md b/content/v2.0/reference/flux/stdlib/experimental/geo/astracks.md index 63ca3bf29..9893b6621 100644 --- a/content/v2.0/reference/flux/stdlib/experimental/geo/astracks.md +++ b/content/v2.0/reference/flux/stdlib/experimental/geo/astracks.md @@ -8,6 +8,8 @@ menu: parent: Geo weight: 401 v2.0/tags: [functions, geo] +related: + - /v2.0/query-data/flux/geo/ --- The `geo.asTracks()` function groups rows into tracks (sequential, related data points). diff --git a/content/v2.0/reference/flux/stdlib/experimental/geo/filterrows.md b/content/v2.0/reference/flux/stdlib/experimental/geo/filterrows.md index a9b849a3a..11c59240a 100644 --- a/content/v2.0/reference/flux/stdlib/experimental/geo/filterrows.md +++ b/content/v2.0/reference/flux/stdlib/experimental/geo/filterrows.md @@ -12,6 +12,7 @@ v2.0/tags: [functions, geo] related: - /v2.0/reference/flux/stdlib/experimental/geo/gridfilter/ - /v2.0/reference/flux/stdlib/experimental/geo/strictfilter/ + - /v2.0/query-data/flux/geo/ --- The `geo.filterRows()` function filters data by a specified geographic region with diff --git a/content/v2.0/reference/flux/stdlib/experimental/geo/gridfilter.md b/content/v2.0/reference/flux/stdlib/experimental/geo/gridfilter.md index c046f0237..edd2a8b21 100644 --- a/content/v2.0/reference/flux/stdlib/experimental/geo/gridfilter.md +++ b/content/v2.0/reference/flux/stdlib/experimental/geo/gridfilter.md @@ -11,6 +11,7 @@ v2.0/tags: [functions, geo] related: - /v2.0/reference/flux/stdlib/experimental/geo/strictfilter/ - /v2.0/reference/flux/stdlib/experimental/geo/filterRows/ + - /v2.0/query-data/flux/geo/ --- The `geo.gridFilter()` function filters data by a specified geographic region. diff --git a/content/v2.0/reference/flux/stdlib/experimental/geo/groupbyarea.md b/content/v2.0/reference/flux/stdlib/experimental/geo/groupbyarea.md index ac9e2e56e..0471ee902 100644 --- a/content/v2.0/reference/flux/stdlib/experimental/geo/groupbyarea.md +++ b/content/v2.0/reference/flux/stdlib/experimental/geo/groupbyarea.md @@ -8,6 +8,8 @@ menu: parent: Geo weight: 401 v2.0/tags: [functions, geo] +related: + - /v2.0/query-data/flux/geo/ --- The `geo.groupByArea()` function groups rows by geographic area. diff --git a/content/v2.0/reference/flux/stdlib/experimental/geo/s2cellidtoken.md b/content/v2.0/reference/flux/stdlib/experimental/geo/s2cellidtoken.md index 01383d397..8e4dc7f38 100644 --- a/content/v2.0/reference/flux/stdlib/experimental/geo/s2cellidtoken.md +++ b/content/v2.0/reference/flux/stdlib/experimental/geo/s2cellidtoken.md @@ -8,6 +8,8 @@ menu: parent: Geo weight: 401 v2.0/tags: [functions, geo] +related: + - /v2.0/query-data/flux/geo/ --- The `geo.s2CellIDToken()` function returns an S2 cell ID token. diff --git a/content/v2.0/reference/flux/stdlib/experimental/geo/shapedata.md b/content/v2.0/reference/flux/stdlib/experimental/geo/shapedata.md index 2fa2f11e2..4ab03fcf2 100644 --- a/content/v2.0/reference/flux/stdlib/experimental/geo/shapedata.md +++ b/content/v2.0/reference/flux/stdlib/experimental/geo/shapedata.md @@ -10,6 +10,8 @@ menu: parent: Geo weight: 401 v2.0/tags: [functions, geo] +related: + - /v2.0/query-data/flux/geo/ --- The `geo.shapeData()` function renames existing latitude and longitude fields to diff --git a/content/v2.0/reference/flux/stdlib/experimental/geo/strictfilter.md b/content/v2.0/reference/flux/stdlib/experimental/geo/strictfilter.md index 76b0982e3..3348a4941 100644 --- a/content/v2.0/reference/flux/stdlib/experimental/geo/strictfilter.md +++ b/content/v2.0/reference/flux/stdlib/experimental/geo/strictfilter.md @@ -12,6 +12,7 @@ related: - /v2.0/reference/flux/stdlib/experimental/geo/gridfilter/ - /v2.0/reference/flux/stdlib/experimental/geo/filterRows/ - /v2.0/reference/flux/stdlib/experimental/geo/toRows/ + - /v2.0/query-data/flux/geo/ --- The `geo.strictFilter()` function filters data by latitude and longitude in a specified region. diff --git a/content/v2.0/reference/flux/stdlib/experimental/geo/torows.md b/content/v2.0/reference/flux/stdlib/experimental/geo/torows.md index 92462fed1..57c3d07a0 100644 --- a/content/v2.0/reference/flux/stdlib/experimental/geo/torows.md +++ b/content/v2.0/reference/flux/stdlib/experimental/geo/torows.md @@ -9,6 +9,7 @@ menu: weight: 401 v2.0/tags: [functions, geo] related: + - /v2.0/query-data/flux/geo/ - /v2.0/reference/flux/stdlib/built-in/transformations/pivot/ --- diff --git a/content/v2.0/reference/flux/stdlib/math/_index.md b/content/v2.0/reference/flux/stdlib/math/_index.md index 1ad8fa2fb..1008a8b91 100644 --- a/content/v2.0/reference/flux/stdlib/math/_index.md +++ b/content/v2.0/reference/flux/stdlib/math/_index.md @@ -12,6 +12,8 @@ menu: parent: Flux standard library weight: 202 v2.0/tags: [math, functions] +related: + - /v2.0/query-data/flux/mathematic-operations/ --- The Flux math package provides basic constants and mathematical functions. diff --git a/content/v2.0/reference/flux/stdlib/sql/_index.md b/content/v2.0/reference/flux/stdlib/sql/_index.md index 316985528..51d3d2c9b 100644 --- a/content/v2.0/reference/flux/stdlib/sql/_index.md +++ b/content/v2.0/reference/flux/stdlib/sql/_index.md @@ -13,6 +13,8 @@ menu: parent: Flux standard library weight: 202 v2.0/tags: [functions, sql, package, mysql, postgres] +related: + - /v2.0/query-data/flux/sql/ --- SQL Flux functions provide tools for working with data in SQL databases such as