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

How to perform linear interpolation? #7028

Open
nieyuan1980 opened this issue Jun 13, 2024 · 1 comment
Open

How to perform linear interpolation? #7028

nieyuan1980 opened this issue Jun 13, 2024 · 1 comment
Labels
enhancement An enhancement to an existing feature for functionality

Comments

@nieyuan1980
Copy link

What type of enhancement is this?

API improvement

What subsystems and features will be improved?

Gapfill

What does the enhancement do?

There is a water meter, and the collector records the reading every hour. The data is as follows:

捕获1

It can be seen that there is missing data at 06:00, 07:00, 08:00, and 09:00. How to linearly interpolate the missing data?

Implementation challenges

No response

@nieyuan1980 nieyuan1980 added the enhancement An enhancement to an existing feature for functionality label Jun 13, 2024
@melicheradam
Copy link

Have you tried this? https://docs.timescale.com/api/latest/hyperfunctions/gapfilling/time_bucket_gapfill/

Straight from the docs

SELECT time_bucket_gapfill('1 hour', time) AS time,
    interpolate(max(value)) as max_reading
    GROUP BY time
    ORDER BY time;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement to an existing feature for functionality
Projects
None yet
Development

No branches or pull requests

2 participants