Jump to content

Swapnil G
Go to solution Solved by Thorsten Vogt,

Recommended Posts

Hi all,

I want to create a time weighted mean for the following situation:

I want to display value of a signal in table form that aggregates values starting from 8am in the morning and averages the value live for 12 hours.

At 20:00, I want the previous 12 hours data to be zero and then restart the averaging of the signal for another 12 hours.

 

Link to comment
Share on other sites

  • Solution

Hi Swapnil, 

you can calculate the average for these periods using the runningAggregate function. I created the 12 hour periods with the following formula:
 

periods(12h, 12h, '2023-01-01T08:00:00', 'CET')

This condition is then used inside the aggregation of the signal:

$signal.runningAggregate(average(), $periods)

The result will be the average value of the signal that resets at the beginning of each capsule:
image.thumb.png.37160b4ff5d80b2b1615585224ac51e6.png

I am not sure what you want to display in the table? Just the last value for the current period?

Regards,

Thorsten

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...