This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Trend accumulate option
#6
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
Reply


Messages In This Thread
Trend accumulate option - by PassivPluss - 05.02.2017, 18:34
RE: Trend accumulate option - by PassivPluss - 05.02.2017, 19:02
RE: Trend accumulate option - by PassivPluss - 05.02.2017, 20:37
RE: Trend accumulate option - by Erwin van der Zwart - 05.02.2017, 23:23
RE: Trend accumulate option - by admin - 06.02.2017, 07:37
RE: Trend accumulate option - by PassivPluss - 06.02.2017, 12:48
RE: Trend accumulate option - by admin - 06.02.2017, 12:50
RE: Trend accumulate option - by PassivPluss - 06.02.2017, 14:42
RE: Trend accumulate option - by fabiorusco - 23.08.2023, 12:45
RE: Trend accumulate option - by Daniel - 23.08.2023, 13:43
RE: Trend accumulate option - by fabiorusco - 09.02.2024, 08:59
RE: Trend accumulate option - by Daniel - 09.02.2024, 09:03
RE: Trend accumulate option - by fabiorusco - 09.02.2024, 10:19
RE: Trend accumulate option - by fabiorusco - 28.02.2024, 13:59
RE: Trend accumulate option - by Daniel - 28.02.2024, 14:03
RE: Trend accumulate option - by fabiorusco - 04.09.2024, 14:33
RE: Trend accumulate option - by admin - 04.09.2024, 14:35
RE: Trend accumulate option - by fabiorusco - 20.09.2024, 11:51
RE: Trend accumulate option - by admin - 20.09.2024, 11:55
RE: Trend accumulate option - by fabiorusco - 20.09.2024, 12:44
RE: Trend accumulate option - by admin - 20.09.2024, 12:46
RE: Trend accumulate option - by fabiorusco - 20.09.2024, 12:57
RE: Trend accumulate option - by admin - 20.09.2024, 12:58
RE: Trend accumulate option - by fabiorusco - 20.09.2024, 13:25

Forum Jump: