Swapnil G Posted October 31, 2023 Share Posted October 31, 2023 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 More sharing options...
Solution Thorsten Vogt Posted October 31, 2023 Solution Share Posted October 31, 2023 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: 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now