Jump to content

How to get the start time of the capsules, compare the value of two variables at the exact moment that the capsule starts?


Go to solution Solved by Chris Harp,

Recommended Posts

  • Seeq Team
  • Solution
Posted (edited)

Hello Manoel,

To compare values at the start of a capsule, you would use Signal from Condition with a summary statistic "Value at Start" for each variable and use the "Start" placement for the timestamp.  This will create two discrete signals at the starting time of your capsule.  To create a condition that compares the two values, use Formula.

You cannot directly compare discrete values in Formula.  You get an error stating "x must be continuous signal at $signal1".  Using the resampleHold function, you hold the discrete value for the length of your desired condition.  For example, if you want your comparison condition duration to be 1 hour, you would use: 

$signal2.resampleHold(1h, 1min) < $signal1.resampleHold(1h, 1min)

image.png

If you wish the have the comparison condition capsule duration be equal to the same duration as the original condition capsule, you could add a .touches() function where the original condition touches the comparison condition.

$comparison = $signal2.resampleHold(1h, 1min) < $signal1.resampleHold(1h, 1min)

$originalCondition.removeLongerThan(40h).touches($comparison)

image.png

Alternatively, you could change the timestamp placement in your signal from conditions to Duration for both and then use value search or formula to create the comparison conditions.  This will create a conditions equal to the length of the original condition.

Please let me know if you have any other questions.  

Chris

Edited by Chris Harp
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...