BriantheBrain Posted December 2, 2024 Posted December 2, 2024 (edited) I have these signals that are periodic but would like to sum up all of these values to present, since the start of 2017 (or when the signal first came online). Basically would like to know the total sum of all those values at any given time and that sum will keep updating. How can it be done? I looked into timeSince() and runningSum() although was not successful in getting either to aggregate properly. Here is the code I am trying to get working: $startDate = capsule('2017-01-01T00:00:00', now()) $signal.runningSum($startDate) Edited December 2, 2024 by BriantheBrain to provide example of my code
Seeq Team John Cox Posted December 2, 2024 Seeq Team Posted December 2, 2024 Hello, The runningSum() function requires a condition as its argument and capsule() only by itself produces a capsule. So, you need to add the condition() function with a max duration parameter, to make $startDate be a condition. In my example below I chose 10 years, which would take you through 2027, but you would have to increase it at that time, or choose something longer than 10yr. Please try the following and see if it helps: $startDate = condition(10yr,capsule('2017-01-01T00:00-05:00', now())) $signal.runningSum($startDate) 1
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