KOstas
KOstas

Reputation: 109

Does PosgreSQL Timescale LOFC allows us to specify an ordering?

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

Answers (1)

KOstas
KOstas

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

Related Questions