Jump to content

Create function to calculate total duration with multiple conditions


Esther
 Share

Recommended Posts

Hello Everyone, 

I hope you are doing well. I need some help with creating a function. I have multiple conditions that I have created that tell me if the equipment is stopped, lag, standby, or other attributes. 
I want to be able to be able to: 
ADD Durations for when equipment is stopped and in lag OR when the equipment is stopped or standby.  

ADD Durations for when equipment is stopped but not in lag or standby. 

The example variables are in hours. 

Stopped ($i5)

Standby($i6)

Lag ($i)

I would appreciate the help. 

Link to comment
Share on other sites

Hi Esther,

based on the information you provided I would create a condition for each of the two durations you want to calculate. To do this in formula I first recommend you to rename the variables for better readability of the formula.

For the first one ("ADD Durations for when equipment is stopped and in lag OR when the equipment is stopped or standby") you may use:

 ($stopped && $lag) || ($stopped || $standby) //-> can be shortened to $stopped || $standby

For the second one ("ADD Durations for when equipment is stopped but not in lag or standby") try:

$stopped && !($lag || $standby)

image.thumb.png.d0ff9fa28df22938a2ea0d5da9db6837.png

Depending on what you want to do with the duration you may use different tools for calculation (e.g. Signal from Condition, Scorecard Metric, use of  capsule properties, ...)

Let me know if you need more help.

Regards,

Thorsten

  • Thanks 2
Link to comment
Share on other sites

Thank you! I appreciate the help. 
I would also like to schedule a signal for these conditions to count the hours on monthly intervals. Is there any way I can designate that? 

Thank you, 

Esther

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
 Share

×
×
  • Create New...