Arithmetic operation and Selectors on time

Hi Team,

I want to capture the total time for a particular test and the start time. Test id work as a unique value for a range.

  1. Calculate the total spent time (last time - first time) with the help of the test ID
    (like this Manipulate timestamps with Flux | InfluxDB OSS 1.8 Documentation)

  2. Display the start time (first time)

help me or guide me on how to extract the above details.

Datasource: InfluxDB 1.8 and using Influxql.

Hello @gerardJ,

  1. I believe your influxql query might look something like this:
SELECT ELAPSED("first-minus_last") FROM SELECT first("water_level"), last("water_level") FROM "h2o_feet" WHERE "location" = 'santa_monica' AND time >= '2015-08-18T00:00:00Z' AND time <= '2015-08-18T00:12:00Z'
  1. SELECT first(“water_level”) FROM “h2o_feet” WHERE “location” = ‘santa_monica’ AND time >= ‘2015-08-18T00:00:00Z’ AND time <= ‘2015-08-18T00:12:00Z’
    InfluxDB doesn’t keep global variables or values. In other words there isn’t a way to get the true first value without query for all of your data.

Out of curiosity, why are you using InfluxDB 1.x instead of 2.x? And what are you doing with InfluxDB?

Thank you!