From b42c464166d81f5ba55c381bdebce07a59ca3977 Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Mon, 22 Jun 2020 14:49:30 -0600 Subject: [PATCH] moved derivative and difference out of aggregate functions, resolves #1059 --- content/v2.0/query-data/flux/rate.md | 2 +- .../transformations/{aggregates => }/derivative.md | 11 ++++++++--- .../transformations/{aggregates => }/difference.md | 11 ++++++++--- 3 files changed, 17 insertions(+), 7 deletions(-) rename content/v2.0/reference/flux/stdlib/built-in/transformations/{aggregates => }/derivative.md (84%) rename content/v2.0/reference/flux/stdlib/built-in/transformations/{aggregates => }/difference.md (90%) diff --git a/content/v2.0/query-data/flux/rate.md b/content/v2.0/query-data/flux/rate.md index fb1a5825b..ec1535cd4 100644 --- a/content/v2.0/query-data/flux/rate.md +++ b/content/v2.0/query-data/flux/rate.md @@ -16,7 +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/built-in/transformations/derivative/ - /v2.0/reference/flux/stdlib/experimental/aggregate/rate/ list_query_example: rate_of_change --- 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/derivative.md similarity index 84% rename from content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/derivative.md rename to content/v2.0/reference/flux/stdlib/built-in/transformations/derivative.md index 8594c0310..21a161c62 100644 --- a/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/derivative.md +++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/derivative.md @@ -7,8 +7,10 @@ aliases: menu: v2_0_ref: name: derivative - parent: built-in-aggregates -weight: 501 + parent: built-in-transformations +weight: 402 +aliases: + - /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/derivative related: - /v2.0/query-data/flux/rate/ - https://docs.influxdata.com/influxdb/latest/query_language/functions/#derivative, InfluxQL – DERIVATIVE() @@ -18,7 +20,7 @@ The `derivative()` function computes the rate of change per [`unit`](#unit) of t It assumes rows are ordered by the `_time` column. The output table schema is the same as the input table. -_**Function type:** Aggregate_ +_**Function type:** Transformation_ _**Output data type:** Float_ ```js @@ -30,6 +32,9 @@ derivative( ) ``` +#### Output tables +For each input table with `n` rows, `derivative()` outputs a table with `n - 1` rows. + ## Parameters ### unit 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/difference.md similarity index 90% rename from content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/difference.md rename to content/v2.0/reference/flux/stdlib/built-in/transformations/difference.md index fb773a363..9f5e6c903 100644 --- a/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/difference.md +++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/difference.md @@ -7,8 +7,10 @@ aliases: menu: v2_0_ref: name: difference - parent: built-in-aggregates -weight: 501 + parent: built-in-transformations +weight: 402 +aliases: + - /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/difference related: - https://docs.influxdata.com/influxdb/latest/query_language/functions/#difference, InfluxQL – DIFFERENCE() --- @@ -16,7 +18,7 @@ related: The `difference()` function computes the difference between subsequent records. The user-specified columns of numeric type are subtracted while others are kept intact. -_**Function type:** Aggregate_ +_**Function type:** Transformation_ _**Output data type:** Float_ ```js @@ -27,6 +29,9 @@ difference( ) ``` +#### Output tables +For each input table with `n` rows, `difference()` outputs a table with `n - 1` rows. + ## Parameters ### nonNegative