Jump to content

Showing Scorecard metric of when signal crosses threshold

Recommended Posts


My aim is to create an organizer topic with a metric that shows the forecast when a signal will cross a threshold. Is there a way to do this?

Or is there another way where I can show in a Date format of when a certain signal is forecasted to cross a threshold that I can insert and automatically update in the organizer. 

Link to comment
Share on other sites

Hello Bayu,

you may try it this way. I set up a sample in which my forecasted value will exceed the threshold two times in the next 3 days:


First step is identifying these periods by using the following formula:

($forecast > $limit).afterStart(0ns)

This will create capsules with zero duration as I just need the timestamps for the points in time when the value will be exceed the limit.

Next step is creating a new signal with the timestamp as the value:

//Iterate over all capsules to create a signal 
//with the value of the timestamp at start of the capsule
$limitExceeded.toSamples($c ->
  //Get date of capsule start
  $date = $c.startKey()
  //Create sample for signal
  sample($c.startKey(), $date)
}, 1s)

Last step is creating the scorecard:


In case you may want to display the timestamp in another format you may read this post and adjust the formula in step 2.

Hope this helps.



  • Like 1
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...