Jump to content

Recommended Posts

Posted (edited)

image.png.6e7ef3ba33cd3e7272a23897ce530aad.png

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 by BriantheBrain
to provide example of my code
  • Seeq Team
Posted

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)

  • Like 1

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...