Aaron Viznei Posted March 21, 2021 Share Posted March 21, 2021 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 More sharing options...
Thorsten Vogt Posted March 22, 2021 Share Posted March 22, 2021 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. $maintenance.inverse().growend(30d).subtract($maintenance) The resulting condition is used inside Signal from Condition Tool: Will this work for you? Regards, Thorsten 1 Link to comment Share on other sites More sharing options...
Aaron Viznei Posted March 22, 2021 Author Share Posted March 22, 2021 Thorsten, I am pretty sure one of the above will work. I will give it a go and revert with any issues. Thank you so much for this. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now