Jump to content

Fixed Date to Now() interval that totalizes hours when composite conditions are met

Recommended Posts

This may be very easy, but I cannot figure it out.   I have say 4 nested composite conditions to be met and the capsules are identified.  I want to totalize the capsules from a fixed date to now().  Basically since last maintenance was performed and want to totalize run hours determined by the intersecting composite conditions.  

I can only find relative time capsules or absolute, but cannot figure out how to use an absolute start date and a now() finish date.

Link to comment
Share on other sites

Hi Aaron,

you can use a formula for this. The following example calculates the total duration of all capsules of the operation condition since 06 Mar 2021 up to now. The result is a scalar.

$operation.aggregate(totalDuration('h'), capsule('2021-03-06T00:00:00Z', now()))


Another option would be creating a condition that can be used in the "Signal from Condition" tool. You have to select an appropriate maximum capsule duration for the condition:

 condition(30d, capsule('2021-03-06T00:00:00Z', now()))


A more dynamic way would be calculating the duration based on the last maintenance. The following formula creates a condition for the times your equipment is running, in case you only have the maintenance capsules. growEnd(30d) extends the capsules to 30 days so you can use it for the current time. As growEnd() extends the capsules to the beginning of the next capsule I use subtract() to remove the maintenance periods from it.


The resulting condition is used inside Signal from Condition Tool:

Will this work for you?



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