Skip to content

Time weighed averages #1991

@m2b

Description

@m2b

Is your feature request related to a problem?

Data from IoT sources is not always at a equal interval. The standard SQL avg assumes the avg=sum(values)/count(values). If the time between samples differs this is not desired. The are many use cases in industry. This can be handled with hyperfunctions in SQL databases. See https://www.timescale.com/blog/what-time-weighted-averages-are-and-why-you-should-care/

Describe the solution you'd like.

Include a Twavg fucntion that can be applied in SQl

SELECT twavg(value) where timestamp between A and B.

Describe alternatives you've considered.

I would hate to have to write custom functions for this.

Additional context.

Look in Google, there are many industry standard applications requiring this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions