Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
dominicanlauf
Contributor III
Contributor III

If-Function instead of number

Hello everybody,  

I have a question regarding a function that I have set up to record all the production operations of a lathe until 19 o'clock. Now I don't want to record until 19 o'clock, but as long as the machine is operated by production staff.

This information is stored in an event log. If the machine.event = 'manned', the machine.event.end should be used as the end time (at the position of 19). The current function is:

sum ({<LatheStatistics.START_TIME = {"= hour (LatheStatistics.START_TIME) <19"}>} LatheStatistics.END_TIME-LatheStatistics.START_TIME) * 24

How should I phrase the expression if I want : if (machine.event = "manned", hour (machine.event.end)) instead of 19?

Many Thanks,

Dominic

1 Solution

Accepted Solutions
Anil_Babu_Samineni

Do you mean this?

sum ({<LatheStatistics.START_TIME = {"= hour (LatheStatistics.START_TIME)<if (machine.event = "manned", hour (machine.event.end))"}>} LatheStatistics.END_TIME-LatheStatistics.START_TIME) * 24

Or

sum ({<LatheStatistics.START_TIME = {"=if (machine.event = "manned", hour (machine.event.end))"}>} LatheStatistics.END_TIME-LatheStatistics.START_TIME) * 24

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful

View solution in original post

4 Replies
Anil_Babu_Samineni

Do you mean this?

sum ({<LatheStatistics.START_TIME = {"= hour (LatheStatistics.START_TIME)<if (machine.event = "manned", hour (machine.event.end))"}>} LatheStatistics.END_TIME-LatheStatistics.START_TIME) * 24

Or

sum ({<LatheStatistics.START_TIME = {"=if (machine.event = "manned", hour (machine.event.end))"}>} LatheStatistics.END_TIME-LatheStatistics.START_TIME) * 24

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
dominicanlauf
Contributor III
Contributor III
Author

Thanks for replying!

I mean the first variant.

But it doesn't work at all!

Anil_Babu_Samineni

When you say, It is not working. My suggest would explain way like

1) Where it is not working

2) What it is not working

3) If this expression says okay, Does values are not matched?

etc.

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
dominicanlauf
Contributor III
Contributor III
Author

My fault, it works!

 

Thank you!