Jump to content

Recommended Posts

Posted

Hi,

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. 

Posted

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:

image.thumb.png.243b0e068b5a6ab770fab2d78b65dd3e.png

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:
image.png.23e251dd3195bdbbaa9aba7f7427479d.png

 

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.

Regards,

Thorsten

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