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

Integral with timeWeightedAvg and stepped line #25464

Open
thkoinje opened this issue Oct 15, 2024 Discussed in #24437 · 0 comments
Open

Integral with timeWeightedAvg and stepped line #25464

thkoinje opened this issue Oct 15, 2024 Discussed in #24437 · 0 comments

Comments

@thkoinje
Copy link

Discussed in #24437

Originally posted by thkoinje October 31, 2023
I would need to calculate the stepped integrated average of a timerange for compressing data.
In the picture there are several measurements shown as red points.
The orange line I guess is the line used to calculate the timeWeightedAverage of the timerange between 0 and 10.
The green line is the needed line for the calculation.
image

Calculation:

Timeinterval Value orange Value green
0-1 1,25 2
1-2 2 1
2-3 2 1
3-4 2,5 3
4-5 3,5 2
5-6 3,5 2
6-7 3,5 2
7-8 4,375 5
8-9 4,375 5
9-10 4,375 5
 
Total 31,375 28
Average 3,1375 2,8

Can you please help me to set this up right?
Up to now it is something like:
|> aggregateWindow( every: 1s, fn: (column, tables=<-) => tables |> timeWeightedAvg(unit: 1s), createEmpty: false)

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

No branches or pull requests

1 participant