0
Count Calculation
Forum / Questions & Answers
What is the best operation to use to count every hour a tag is On (active, =1) for an entire week or 168 hrs. Then reset at the end of the week and start counting again?
1 reply
-
Hi zachary. zeppuhar ,
You would want to use the ResettingAnchoredInterval function in conjunction with the DurationInStateNonZero aggregate. It will look like this:
DurationInStateNonZero outputs milliseconds which is why I have the division afterwards to convert it to hours. I have it set to calculate periodically every hour. It will then reset at midnight on Sunday and start its count over again.
Hope this works for you.