Elapsed or Lag function for iox sql query

I am trying to migrate a flux query that uses elapsed() to an iox bucket. is there something equivalent? this is called lag in some databases.

Hello @stanton009,
Are you using InfluxDB v3?
It uses the Apache Datafusion SQL framework under the hood so theoretically all of the functions that it supports should be available although they haven’t all been tested: