hello, I have a tag which have historical activated… I want to obtain the average value in a range of days (like from 2021-08-01 to 2021-08-30) and in a range of hours (those days but only from 7:00 am to 8 am)
more exactly the tag is an OEE calculation by hour from a machine… this tag change every minute depending of the production of the machine itself… and when the hour change the tag got a reset and star the calculation again…
so i need the “Last value” from the hours, and then get the average of days…
day 1 from 7-8hrs 57.8
day 2 from 7-8hrs 65.2
…
last day from 7-8hrs 87.4
the average value of the OEE of the machine from 7-8hrs during the month was: 70.1
What I will try is to use the system.tag.queryTagHistory in a python for to obtain the last value of every hour (Periodic 1 hour) of the first day and storing it in a data set row and then add 1 day to the filter of time and do it again until the starday were the endday, and then somehow calculate the average in python of the dataset…
but I don’t know if there is another easiest way to do it…