InfluxQL transformation functions modify and return values each row of queried data.
Each transformation function below covers syntax, including parameters to pass to the function, and examples of how to use the function. Examples use NOAA water sample data and data from sample_test.txt.
Calculate the absolute values of field values associated with each field key in a measurement
Return the absolute values of field values for each field key that stores numeric values in the data measurement.
The h2o_feet measurement has one numeric field water_level.
Calculate the absolute values of field values associated with a field key and include several clauses
Return the absolute values of field values associated with the water_level
field key in the time range
between 2019-08-18T00:00:00Z and 2019-08-18T00:30:00Z with results in
descending timestamp order.
The query also limits
the number of points returned to four and offsets
results by two points.
The advanced syntax requires a GROUP BY time() clause and a nested InfluxQL function.
The query first calculates the results for the nested function at the specified GROUP BY time() interval and then applies the ABS() function to those results.
Returns the arccosine (in radians) of the field value. Field values must be between -1 and 1. Supports GROUP BY clauses that group by tags but does not support group by time.
ACOS(field_key)
Returns the arccosine of field values associated with the field key.
ACOS(*)
Returns the arccosine of field values associated with each field key in the measurement.
ACOS() supports int64 and float64 field value data types with values between -1 and 1.
Examples
The examples below use a subset of data from sample_test.txt, which only includes field values within the calculable range (-1 to 1). This value range is required for the ACOS() function:
time
a
2018-06-24T12:01:00Z
-0.774984088561186
2018-06-24T12:02:00Z
-0.921037167720451
2018-06-24T12:04:00Z
-0.905980032168252
2018-06-24T12:05:00Z
-0.891164752631417
2018-06-24T12:09:00Z
0.416579917279588
2018-06-24T12:10:00Z
0.328968116955350
2018-06-24T12:11:00Z
0.263585064411983
Calculate the arccosine of field values associated with a field key
Return the arccosine of field values in the a field key in the data measurement.
Calculate the arccosine of field values associated with a field key and include several clauses
Return the arccosine of field values associated with the a field key in the time range between 2018-06-24T00:00:00Z and 2018-06-25T00:00:00Z with results in descending timestamp order.
The query also limits the number of points returned to four and offsets results by two points.
The advanced syntax requires a GROUP BY time() clause and a nested InfluxQL function.
The query first calculates the results for the nested function at the specified GROUP BY time() interval and then applies the ACOS() function to those results.
Calculate the arcsine of field values associated with each field key in a measurement
Return the arcsine of field values for each field key that stores numeric values in the data measurement.
The data measurement has one numeric field: a.
Calculate the arcsine of field values associated with a field key and include several clauses
Return the arcsine of field values associated with the a field key in the
time range
between 2018-06-24T00:00:00Z and 2018-06-25T00:00:00Z with results in
descending timestamp order.
The query also limits
the number of points returned to four and offsets
results by two points.
The advanced syntax requires a GROUP BY time() clause and a nested InfluxQL function.
The query first calculates the results for the nested function at the specified GROUP BY time() interval and then applies the ASIN() function to those results.
ATAN(field_key)
Returns the arctangent of field values associated with the field key.
ATAN(*)
Returns the arctangent of field values associated with each field key in the measurement.
ATAN() supports int64 and float64 field value data types with values between -1 and 1.
Examples
The examples below use a subset of data from sample_test.txt that only includes field values within the calculable range (-1 to 1) required for the of the ATAN() function.
Calculate the arctangent of field values associated with a field key
Return the arctangent of field values in the a field key in the data measurement.
Calculate the arctangent of field values associated with a field key and include several clauses
Return the arctangent of field values associated with the a field key in
time range
between 2017-05-01T00:00:00Z and 2017-05-09T00:00:00Z and returns results in
descending timestamp order.
The query also limits
the number of points returned to four and offsets
results by two points.
The advanced syntax requires a GROUP BY time() clause and a nested InfluxQL function.
The query first calculates the results for the nested function at the specified GROUP BY time() interval and then applies the ATAN() function to those results.
ATAN2(field_key_y, field_key_x)
Returns the arctangent of field values associated with the field key, field_key_y, divided by field values associated with field_key_x.
ATAN2(*, field_key_x)
Returns the field values associated with each field key in the measurement
divided by field values associated with field_key_x.
ATAN2() supports int64 and float64 field value data types.
Calculate the arctangent of values associated with each field key in a measurement divided by field_key_a
Return the arctangents of all numeric field values in the data measurement divided by values in the a field key.
The data measurement has two numeric fields: a and b.
Calculate the arctangents of field values and include several clauses
Return the arctangent of field values associated with the a field key divided
by the b field key in the time range
between 2018-05-16T12:10:00Z and 2018-05-16T12:10:00Z with results in
descending timestamp order.
The query also limits
the number of points returned to four and offsets
results by two points.
The advanced syntax requires a GROUP BY time() clause and a nested InfluxQL function.
The query first calculates the results for the nested function at the specified GROUP BY time() interval and then applies the ATAN2() function to those results.
Calculate the ceiling of field values associated with each field key in a measurement
Return field values for each field key that stores numeric values in the h2o_feet
measurement rounded up to the nearest integer.
The h2o_feet measurement has one numeric field: water_level.
Calculate the ceiling of field values associated with a field key and include several clauses
Return field values associated with the water_level field key rounded up to the
nearest integer in the time range
between 2019-08-18T00:00:00Z and 2019-08-18T00:30:00Z with results in
descending timestamp order.
The query also limits
the number of points returned to four and offsets
results by two points.
The advanced syntax requires a GROUP BY time() clause and a nested InfluxQL function.
The query first calculates the results for the nested function at the specified GROUP BY time() interval and then applies the CEIL() function to those results.
Calculate the cosine of field values associated with a field key and include several clauses
Return the cosine of field values associated with the water_level field key
in the time range
between 2019-08-18T00:00:00Z and 2019-08-18T00:30:00Z with results in
descending timestamp order.
The query also limits
the number of points returned to four and offsets
results by two points.
The advanced syntax requires a GROUP BY time() clause and a nested InfluxQL function.
The query first calculates the results for the nested function at the specified GROUP BY time() interval and then applies the COS() function to those results.
CUMULATIVE_SUM(field_key)
Returns the running total of subsequent field values associated with the field key.
CUMULATIVE_SUM(/regular_expression/)
Returns the running total of subsequent field values associated with each field key that matches the regular expression.
CUMULATIVE_SUM(*)
Returns the running total of subsequent field values associated with each field key in the measurement.
CUMULATIVE_SUM() supports int64 and float64 field value data types.
Supports GROUP BY clauses that group by tags but not GROUP BY clauses that group by time.
To use CUMULATIVE_SUM() with a GROUP BY time() clause, see Advanced syntax.
Calculate the cumulative sum of the field values associated with each field key in a measurement
Return the running total of the field values for each numeric field in the h2o_feet measurement.
The h2o_feet measurement has one numeric field: water_level.
Calculate the cumulative sum of the field values associated with a field key and include several clauses
Return the running total of the field values associated with the water_level
field key in the time range
between 2019-08-18T00:00:00Z and 2019-08-18T00:30:00Z with results in
descending timestamp order.
The query also limits
the number of points returned to four and offsets
results by two points.
The advanced syntax requires a GROUP BY time() clause and a nested InfluxQL function.
The query first calculates the results for the nested function at the specified GROUP BY time() interval and then applies the CUMULATIVE_SUM() function to those results.
InfluxDB calculates the difference between subsequent field values and converts those results into the rate of change per unit.
The unit argument is an integer followed by a duration and it is optional.
If the query does not specify the unit the unit defaults to one second (1s).
DERIVATIVE(field_key)
Returns the rate of change between subsequent field values associated with the field key.
DERIVATIVE(/regular_expression/)
Returns the rate of change between subsequent field values associated with each field key that matches the regular expression.
DERIVATIVE(*)
Returns the rate of change between subsequent field values associated with each field key in the measurement.
DERIVATIVE() supports int64 and float64 field value data types.
The first result (0.0000750000) is the one-second rate of change between the first two subsequent field values in the raw data. InfluxDB calculates the difference between the field values (subtracts the first field value from the second field value) and then normalizes that value to the one-second rate of change (dividing the difference between the field values’ timestamps in seconds (360s) by the default unit (1s)):
(2.379 - 2.352) / (360s / 1s)
Calculate the derivative between the field values associated with a field key and specify the unit option
Return the six-minute rate of change between the field values in the water_level field in the h2o_feet measurement.
The first result (0.0270000000) is the six-minute rate of change between the first two subsequent field values in the raw data. InfluxDB calculates the difference between the field values (subtracts the first field value from the second field value) and then normalizes that value to the six-minute rate of change (dividing the difference between the field values’ timestamps in minutes (6m) by the specified interval (6m)):
(2.379 - 2.352) / (6m / 6m)
Calculate the derivative between the field values associated with each field key in a measurement and specify the unit option
Returns three-minute rate of change between the field values associated with each field key that stores numeric values in the h2o_feet measurement.
The h2o_feet measurement has one numeric field: water_level.
The first result (0.0135000000) is the three-minute rate of change between the first two subsequent field values in the raw data.
InfluxDB calculates the difference between the field values (subtracts the first field value from the second field value) and then normalizes that value to the three-minute rate of change (dividing the difference between the field values’ timestamps in minutes (6m) by the specified interval (3m)):
(2.379 - 2.352) / (6m / 3m)
Calculate the derivative between the field values associated with each field key that matches a regular expression and specify the unit option
Return the two-minute rate of change between the field values associated with
each field key that stores numeric values and includes the word water in the
h2o_feet measurement.
The first result (0.0090000000) is the two-minute rate of change between the first two subsequent field values in the raw data.
InfluxDB calculates the difference between the field values (subtracts the first field value from the second field value) and then normalizes that value to the three-minute rate of change (dividing the difference between the field values’ timestamps in minutes (6m) by the specified interval (2m)):
(2.379 - 2.352) / (6m / 2m)
Calculate the derivative between the field values associated with a field key and include several clauses
Return the one-second rate of change between water_level field values in the
h2o_feet measurement in time range
between 2019-08-18T00:00:00Z and 2019-08-18T00:30:00Z with results in
descending timestamp order.
The query also limits the number of points returned to one and offsets results by two points.
The only result (0.0000388889) is the one-second rate of change between the relevant subsequent field values in the raw data. InfluxDB calculates the difference between the field values (subtracts the first field value from the second field value) and then normalizes that value to the one-second rate of change (dividing the difference between the field values’ timestamps in seconds (360) by the specified rate of change (1s)):
The advanced syntax requires a GROUP BY time() clause and a nested InfluxQL function.
The query first calculates the results for the nested function at the specified GROUP BY time() interval and then applies the DERIVATIVE() function to those results.
The unit argument is an integer followed by a duration and it is optional.
If the query does not specify the unit the unit defaults to the GROUP BY time() interval.
Note that this behavior is different from the basic syntax’s default behavior.
DIFFERENCE(field_key)
Returns the difference between subsequent field values associated with the field key.
DIFFERENCE(/regular_expression/)
Returns the difference between subsequent field values associated with each field key that matches the regular expression.
DIFFERENCE(*)
Returns the difference between subsequent field values associated with each field key in the measurement.
DIFFERENCE() supports int64 and float64 field value data types.
Calculate the difference between the field values associated with each field key in a measurement
Return the difference between the subsequent field values for each field key
that stores numeric values in the h2o_feet measurement.
The h2o_feet measurement has one numeric field: water_level.
Calculate the difference between the field values associated with each field key that matches a regular expression
Return the difference between the subsequent field values for each field key
that stores numeric values and includes the word water in the h2o_feet measurement.
Return the difference between the subsequent field values in the water_level
field key in the time range
between 2019-08-18T00:00:00Z and 2019-08-18T00:30:00Z with results in
descending timestamp order.
They query also limits
the number of points returned to two and offsets
results by two points.
The advanced syntax requires a GROUP BY time() clause and a nested InfluxQL function.
The query first calculates the results for the nested function at the specified GROUP BY time() interval and then applies the DIFFERENCE() function to those results.
InfluxDB calculates the difference between subsequent timestamps.
The unit option is an integer followed by a duration and it determines the unit of the returned difference.
If the query does not specify the unit option the query returns the difference between timestamps in nanoseconds.
ELAPSED(field_key)
Returns the difference between subsequent timestamps associated with the field key.
ELAPSED(/regular_expression/)
Returns the difference between subsequent timestamps associated with each field key that matches the regular expression.
ELAPSED(*)
Returns the difference between subsequent timestamps associated with each field key in the measurement.
Calculate the elapsed time between field values associated with each field key in a measurement and specify the unit option
Return the difference (in minutes) between subsequent timestamps associated with
each field key in the h2o_feetmeasurement.
The h2o_feet measurement has two field keys: level description and water_level.
Calculate the elapsed time between field values associated with each field key that matches a regular expression and specify the unit option
Return the difference (in seconds) between subsequent timestamps associated with
each field key that includes the word level in the h2o_feet measurement.
Calculate the elapsed time between field values associated with a field key and include several clauses
Return the difference (in milliseconds) between subsequent timestamps in the
water_level field key and in the h2o_feet measurement in the
time range
between 2019-08-17T00:00:00Z and 2019-08-17T00:12:00Z with timestamps in
descending order.
The query also limits
the number of points returned to one and offsets
results by one point.
Notice that the result is negative; the ORDER BY time DESC clause sorts timestamps in descending order so ELAPSED() calculates the difference between timestamps in reverse order.
Common issues with ELAPSED()
ELAPSED() and units greater than the elapsed time
InfluxDB returns 0 if the unit option is greater than the difference between the timestamps.
Example
The timestamps in the h2o_feet measurement occur at six-minute intervals.
If the query sets the unit option to one hour, InfluxDB returns 0:
The ELAPSED() function supports the GROUP BY time() clause but the query results aren’t particularly useful.
Currently, an ELAPSED() query with a nested function and a GROUP BY time() clause simply returns the interval specified in the GROUP BY time() clause.
The GROUP BY time() clause determines the timestamps in the results; each timestamp marks the start of a time interval.
That behavior also applies to nested selector functions (like FIRST() or MAX()) which would, in all other cases, return a specific timestamp from the raw data.
Because the GROUP BY time() clause overrides the original timestamps, the ELAPSED() calculation always returns the same value as the GROUP BY time() interval.
Example
In the codeblock below, the first query attempts to use the ELAPSED() function with a GROUP BY time() clause to find the time elapsed (in minutes) between minimumwater_levels.
Returns 12 minutes for both time intervals.
To get those results, InfluxDB first calculates the minimum water_levels at 12-minute intervals.
The second query in the codeblock shows the results of that step.
The step is the same as using the MIN() function with the GROUP BY time() clause and without the ELAPSED() function.
Notice that the timestamps returned by the second query are 12 minutes apart.
In the raw data, the first result (2.0930000000) occurs at 2019-08-18T00:42:00Z but the GROUP BY time() clause overrides that original timestamp.
Because the timestamps are determined by the GROUP BY time() interval and not by the original data, the ELAPSED() calculation always returns the same value as the GROUP BY time() interval.
Calculate the exponential of field values associated with each field key in a measurement
Return the exponential of field values for each field key that stores numeric
values in the h2o_feet measurement.
The h2o_feet measurement has one numeric field: water_level.
Return the exponentials of field values associated with the water_level field key in
the time range
between 2019-08-18T00:00:00Z and 2019-08-18T00:30:00Z with results in
descending timestamp order.
The query also limits
the number of points returned to four and offsets
results by two points.
The advanced syntax requires a GROUP BY time() clause and a nested InfluxQL function.
The query first calculates the results for the nested function at the specified GROUP BY time() interval and then applies the EXP() function to those results.
Calculate the floor of field values associated with each field key in a measurement
Return field values for each field key that stores numeric values in the
h2o_feet measurement rounded down to the nearest integer.
The h2o_feet measurement has one numeric field: water_level.
Calculate the floor of field values associated with a field key and include several clauses
Return field values associated with the water_level field key rounded down to
the nearest integer in the time range
between 2019-08-18T00:00:00Z and 2019-08-18T00:30:00Z with results in
descending timestamp order.
The query also limits
the number of points returned to four and offsets
results by two points.
The advanced syntax requires a GROUP BY time() clause and a nested InfluxQL function.
The query first calculates the results for the nested function at the specified GROUP BY time() interval and then applies the FLOOR() function to those results.
InfluxQL does not currently support histogram generation.
For information about creating histograms with data stored in InfluxDB, see
Flux’s histogram() function.
Calculate the natural logarithm of field values associated with each field key in a measurement
Return the natural logarithm of field values for each field key that stores
numeric values in the h2o_feet measurement.
The h2o_feet measurement has one numeric field: water_level.
Return the natural logarithms of field values associated with the water_level
field key in the time range
between 2019-08-18T00:00:00Z and 2019-08-18T00:30:00Z with results in
descending timestamp order.
The query also limits
the number of points returned to four and offsets
results by two points.
The advanced syntax requires a GROUP BY time() clause and a nested InfluxQL function.
The query first calculates the results for the nested function at the specified GROUP BY time() interval and then applies the LN() function to those results.
Calculate the logarithm base 4 of field values associated with each field key in a measurement
Return the logarithm base 4 of field values for each numeric field in the h2o_feet measurement.
The h2o_feet measurement has one numeric field: water_level.
Calculate the logarithm base 4 of field values associated with a field key and include several clauses
Return the logarithm base 4 of field values associated with the water_level
field key in the time range
between 2019-08-18T00:00:00Z and 2019-08-18T00:30:00Z with results in
descending timestamp order.
The query also limits
the number of points returned to four and offsets
results by two points.
The advanced syntax requires a GROUP BY time() clause and a nested InfluxQL function.
The query first calculates the results for the nested function at the specified GROUP BY time() interval and then applies the LOG() function to those results.
Return the logarithm base 2 of field values for each numeric field in the h2o_feet measurement.
The h2o_feet measurement has one numeric field: water_level.
Calculate the logarithm base 2 of field values associated with a field key and include several clauses
Return the logarithm base 2 of field values associated with the water_level
field key in the time range
between 2019-08-18T00:00:00Z and 2019-08-18T00:30:00Z with results in
descending timestamp order.
The query also limits
the number of points returned to four and offsets
results by two points.
The advanced syntax requires a GROUP BY time() clause and a nested InfluxQL function.
The query first calculates the results for the nested function at the specified GROUP BY time() interval and then applies the LOG2() function to those results.
Calculate the logarithm base 10 of field values associated with each field key in a measurement
Return the logarithm base 10 of field values for each numeric field in the h2o_feet measurement.
The h2o_feet measurement has one numeric field: water_level.
Calculate the logarithm base 10 of field values associated with a field key and include several clauses
Return the logarithm base 10 of field values associated with the water_level
field key in the time range
between 2019-08-18T00:00:00Z and 2019-08-18T00:30:00Z with results in
descending timestamp order.
The query also limits
the number of points returned to four and offsets
results by two points.
The advanced syntax requires a GROUP BY time() clause and a nested InfluxQL function.
The query first calculates the results for the nested function at the specified GROUP BY time() interval and then applies the LOG10() function to those results.
MOVING_AVERAGE() calculates the rolling average across a window of N subsequent field values.
The N argument is an integer and it is required.
MOVING_AVERAGE(field_key,N)
Returns the rolling average across N field values associated with the field key.
MOVING_AVERAGE(/regular_expression/,N)
Returns the rolling average across N field values associated with each field key that matches the regular expression.
MOVING_AVERAGE(*,N)
Returns the rolling average across N field values associated with each field key in the measurement.
MOVING_AVERAGE() int64 and float64 field value data types.
Supports GROUP BY clauses that group by tags but not GROUP BY clauses that group by time.
To use MOVING_AVERAGE() with a GROUP BY time() clause, see Advanced syntax.
The first result (2.3655000000) is the average of the first two points in the raw data: (2.3520000000 + 2.3790000000) / 2).
The second result (2.3610000000) is the average of the second two points in the raw data: (2.3790000000 + 2.3430000000) / 2).
Calculate the moving average of the field values associated with each field key in a measurement
Return the rolling average across a three-field-value window for each field key
that stores numeric values in the h2o_feet measurement.
The h2o_feet measurement has one numeric field: water_level.
Calculate the moving average of the field values associated with each field key that matches a regular expression
Return the rolling average across a four-field-value window for each numeric
field with a field key that includes the word level in the h2o_feet measurement.
Calculate the moving average of the field values associated with a field key and include several clauses
Return the rolling average across a two-field-value window for the water_level
field key in the h2o_feet measurement in the time range
between 2019-08-18T00:00:00Z and 2019-08-18T00:30:00Z with results in
descending timestamp order.
The query also limits
the number of points returned to two and offsets
results by three points.
The advanced syntax requires a GROUP BY time() clause and a nested InfluxQL function.
The query first calculates the results for the nested function at the specified GROUP BY time() interval and then applies the MOVING_AVERAGE() function to those results.
Returns the non-negative rate of change between subsequent field values.
Non-negative rates of change include positive rates of change and rates of change that equal zero.
InfluxDB calculates the difference between subsequent field values and converts those results into the rate of change per unit.
The unit argument is an integer followed by a duration and it is optional.
If the query does not specify the unit, the unit defaults to one second (1s).
NON_NEGATIVE_DERIVATIVE() returns only positive rates of change or rates of change that equal zero.
NON_NEGATIVE_DERIVATIVE(field_key)
Returns the non-negative rate of change between subsequent field values associated with the field key.
NON_NEGATIVE_DERIVATIVE(/regular_expression/)
Returns the non-negative rate of change between subsequent field values associated with each field key that matches the regular expression.
NON_NEGATIVE_DERIVATIVE(*)
Returns the non-negative rate of change between subsequent field values associated with each field key in the measurement.
NON_NEGATIVE_DERIVATIVE() supports int64 and float64 field value data types.
Supports GROUP BY clauses that group by tags but not GROUP BY clauses that group by time.
To use NON_NEGATIVE_DERIVATIVE() with a GROUP BY time() clause, see Advanced syntax.
Examples
See the examples in the DERIVATIVE() documentation.
NON_NEGATIVE_DERIVATIVE() behaves the same as the DERIVATIVE() function but NON_NEGATIVE_DERIVATIVE() returns only positive rates of change or rates of change that equal zero.
The advanced syntax requires a GROUP BY time() clause and a nested InfluxQL function.
The query first calculates the results for the nested function at the specified GROUP BY time() interval and then applies the NON_NEGATIVE_DERIVATIVE() function to those results.
The unit argument is an integer followed by a duration and it is optional.
If the query does not specify the unit, the unit defaults to the GROUP BY time() interval.
Note that this behavior is different from the basic syntax’s default behavior.
NON_NEGATIVE_DERIVATIVE() returns only positive rates of change or rates of change that equal zero.
See the examples in the DERIVATIVE() documentation.
NON_NEGATIVE_DERIVATIVE() behaves the same as the DERIVATIVE() function but NON_NEGATIVE_DERIVATIVE() returns only positive rates of change or rates of change that equal zero.
NON_NEGATIVE_DIFFERENCE()
Returns the non-negative result of subtraction between subsequent field values.
Non-negative results of subtraction include positive differences and differences that equal zero.
NON_NEGATIVE_DIFFERENCE(field_key)
Returns the non-negative difference between subsequent field values associated with the field key.
NON_NEGATIVE_DIFFERENCE(/regular_expression/)
Returns the non-negative difference between subsequent field values associated with each field key that matches the regular expression.
NON_NEGATIVE_DIFFERENCE(*)
Returns the non-negative difference between subsequent field values associated with each field key in the measurement.
NON_NEGATIVE_DIFFERENCE() supports int64 and float64 field value data types.
Supports GROUP BY clauses that group by tags but not GROUP BY clauses that group by time.
To use NON_NEGATIVE_DIFFERENCE() with a GROUP BY time() clause, see Advanced syntax.
Examples
See the examples in the DIFFERENCE() documentation.
NON_NEGATIVE_DIFFERENCE() behaves the same as the DIFFERENCE() function but NON_NEGATIVE_DIFFERENCE() returns only positive differences or differences that equal zero.
The advanced syntax requires a GROUP BY time() clause and a nested InfluxQL function.
The query first calculates the results for the nested function at the specified GROUP BY time() interval and then applies the NON_NEGATIVE_DIFFERENCE() function to those results.
See the examples in the DIFFERENCE() documentation.
NON_NEGATIVE_DIFFERENCE() behaves the same as the DIFFERENCE() function but NON_NEGATIVE_DIFFERENCE() returns only positive differences or differences that equal zero.
Calculate field values associated with each field key in a measurement to the power of 4
Return field values for each field key that stores numeric values in the h2o_feet measurement multiplied to the power of 4.
The h2o_feet measurement has one numeric field: water_level.
Calculate field values associated with a field key to the power of 4 and include several clauses
Return field values associated with the water_level field key multiplied to
the power of 4 in the time range
between 2019-08-18T00:00:00Z and 2019-08-18T00:30:00Z with results in
descending timestamp order.
The query also limits
the number of points returned to four and offsets
results by two points.
The advanced syntax requires a GROUP BY time() clause and a nested InfluxQL function.
The query first calculates the results for the nested function at the specified GROUP BY time() interval and then applies the POW() function to those results.
ROUND(field_key)
Returns the field values associated with the field key rounded to the nearest integer.
ROUND(*)
Returns the field values associated with each field key in the measurement rounded to the nearest integer.
ROUND() supports int64 and float64 field value data types.
Supports GROUP BY clauses that group by tags but not GROUP BY clauses that [group by time](/influxdb/v2/. To use ROUND() with a GROUP BY time() clause, see Advanced syntax.
Round field values associated with each field key in a measurement
Return field values for each numeric field in the h2o_feet measurement rounded to the nearest integer.
The h2o_feet measurement has one numeric field: water_level.
Round field values associated with a field key and include several clauses
Return field values associated with the water_level field key rounded to the
nearest integer in the time range
between 2019-08-18T00:00:00Z and 2019-08-18T00:30:00Z with results in
descending timestamp order.
The query also limits
the number of points returned to four and offsets
results by two points.
The advanced syntax requires a GROUP BY time() clause and a nested InfluxQL function.
The query first calculates the results for the nested function at the specified GROUP BY time() interval and then applies the ROUND() function to those results.
Calculate the sine of field values associated with a field key and include several clauses
Return the sine of field values associated with the water_level
field key in the time range
between 2019-08-18T00:00:00Z and 2019-08-18T00:30:00Z with results in
descending timestamp order.
The query also limits
the number of points returned to four and offsets
results by two points.
The advanced syntax requires a GROUP BY time() clause and a nested InfluxQL function.
The query first calculates the results for the nested function at the specified GROUP BY time() interval and then applies the SIN() function to those results.
Calculate the square root of field values associated with each field key in a measurement
Return the square roots of field values for each numeric field in the h2o_feet measurement.
The h2o_feet measurement has one numeric field: water_level.
Calculate the square root of field values associated with a field key and include several clauses
Return the square roots of field values associated with the water_level
field key in the time range
between 2019-08-18T00:00:00Z and 2019-08-18T00:30:00Z with results in
descending timestamp order.
The query also limits
the number of points returned to four and offsets
results by two points.
The advanced syntax requires a GROUP BY time() clause and a nested InfluxQL function.
The query first calculates the results for the nested function at the specified GROUP BY time() interval and then applies the SQRT() function to those results.
Calculate the tangent of field values associated with a field key and include several clauses
Return the tangent of field values associated with the water_level
field key in the time range
between 2019-08-18T00:00:00Z and 2019-08-18T00:30:00Z with results in
descending timestamp order.
The query also limits
the number of points returned to four and offsets
results by two points.
The advanced syntax requires a GROUP BY time() clause and a nested InfluxQL function.
The query first calculates the results for the nested function at the specified GROUP BY time() interval and then applies the TAN() function to those results.
Thank you for being part of our community!
We welcome and encourage your feedback and bug reports for InfluxDB and this documentation.
To find support, use the following resources:
InfluxDB v3 enhancements and InfluxDB Clustered is now generally available
New capabilities, including faster query performance and management
tooling advance the InfluxDB v3 product line.
InfluxDB Clustered is now generally available.
InfluxDB v3 performance and features
The InfluxDB v3 product line has seen significant enhancements in query
performance and has made new management tooling available. These enhancements
include an operational dashboard to monitor the health of your InfluxDB cluster,
single sign-on (SSO) support in InfluxDB Cloud Dedicated, and new management
APIs for tokens and databases.