05.02.2017, 23:23
(This post was last modified: 06.02.2017, 00:26 by Erwin van der Zwart.)
Okay new approach (:
Well what you could do in this case is create a dummy object and create a trend to this dummy object and create a scheduled script that runs once a day at 0:01. (or run every x minutes if you want multiple points in between)
In this scheduled script you do a trends.fetchone on the trend with the 24 points, this will give you a average day value of your day values. Write this result once a day to your dummy object and the second trend attached to the dummy object will show your day average value(s).
If you want a total sum of the day values you can do a trend.fetch (instead of the fetchone) this will result in a data set of the full day and do a loop through the result table to sum all values and write the sum result to your dummy object, this results in a trend with sum of day values.
See http://openrb.com/docs/trends-new.htm for a sample how to fetch one average day value or a table with day values where you can loop through to sum up the day values.
BR,
Erwin
Well what you could do in this case is create a dummy object and create a trend to this dummy object and create a scheduled script that runs once a day at 0:01. (or run every x minutes if you want multiple points in between)
In this scheduled script you do a trends.fetchone on the trend with the 24 points, this will give you a average day value of your day values. Write this result once a day to your dummy object and the second trend attached to the dummy object will show your day average value(s).
If you want a total sum of the day values you can do a trend.fetch (instead of the fetchone) this will result in a data set of the full day and do a loop through the result table to sum all values and write the sum result to your dummy object, this results in a trend with sum of day values.
See http://openrb.com/docs/trends-new.htm for a sample how to fetch one average day value or a table with day values where you can loop through to sum up the day values.
BR,
Erwin