0

Count Calculation

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?

1reply Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • 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.

    Like 1
print this pagePrint this page
Like Follow
  • 6 mths agoLast active
  • 1Replies
  • 63Views
  • 2 Following