Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support fill(previous) where first value is missing and outside of time bounds. #724

Closed
adamperlin opened this issue Jul 3, 2018 · 3 comments

Comments

@adamperlin
Copy link
Contributor

From ifql created by nathanielc : influxdata/ifql#210

influxdata/influxdb#5943

@aanthony1243
Copy link
Contributor

related to #272

@mark-rushakoff mark-rushakoff transferred this issue from another repository Jan 8, 2019
@russorat russorat added enhancement New feature or request func/fill labels Mar 4, 2020
@SGStino
Copy link

SGStino commented Jul 30, 2020

first value missing also applies to non-windowed queries:

previous = from(bucket: "Data")
  |> range(stop: v.timeRangeStart, start: 0) 
  |> filter(fn: (r) => r["_measurement"] == "Tags.PLC_252.TANK1.STAPNR")
  |> filter(fn: (r) => r["_field"] == "value")  
  |> last()
  
current = from(bucket: "Data")
  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)
  |> filter(fn: (r) => r["_measurement"] == "Tags.PLC_252.TANK1.STAPNR")
  |> filter(fn: (r) => r["_field"] == "value")  

union(tables: [previous, current])  

(aside of an issue that this results in two tables in the final result set), a shortcut would be nice there too.
not sure if fill(use_previous:true) should fix this though, or something else?

Copy link

This issue has had no recent activity and will be closed soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants