Reputation: 109
Is there a way to fill the missing values in a gap fill, using future observations instead of past ones? This could be achieved if locf
allowed us to specify an ordering, which I think is not possible.
What we want, is to make locf
(Last Observation Carried Forward) work like a hypothetical “Next Observation Carried Backward” function.
Upvotes: 1
Views: 198
Reputation: 109
This is an answer from a TImeScale expert: At the moment, there is no direct way to do this. If you don't need to do it in a Continuous Aggregate, there could be opportunities to get the buckets through an outer query, and then return your own future values on a LATERAL join per bucket or a similar technique.
Upvotes: 0