Removing a Process from Calculation based on Time between two activities

Hi ,

I am trying to remove a process step from the Cycle Time calculation. This Process takes the Longest Time and so i want to remove it from the Calculation.

For Example I have 4 process Steps which are Starting from A and then ending at D and B & C activity’s are in between. Lets Say From A to D it takes 24hrs in total. But the process from A to B takes the longest which is about 20 hrs. So i want to remove this 20 hrs from the Calculation.

This is just a simple example but i want something that checks each and every Source and Target and remove the activity based on the Time between those two activities.

Thanks,
Sravan

Hi Sravan

you can calculate the time between each Activity and the previous Activity with this:

HOURS_BETWEEN(
ACTIVITY_LAG("ACTIVITIES"."EVENTTIME"), "ACTIVITIES"."EVENTTIME"
)

In order to always exclude the longest time between two activities inside a case, you can use INDEX_ORDER to index the Activities based on the time between them:

INDEX_ORDER(
HOURS_BETWEEN(ACTIVITY_LAG("ACTIVITIES"."EVENTTIME"), "ACTIVITIES"."EVENTTIME"), 
ORDER BY ( HOURS_BETWEEN(ACTIVITY_LAG("ACTIVITIES"."EVENTTIME"), "ACTIVITIES"."EVENTTIME") DESC ), 
PARTITION BY ( "ACTIVITIES"."_CASE_KEY" )
)

This will return a 1 for the longest time per case, a 2 for the second-longest time per case, and so on. So you can now calculate the throughput time per case without the longest time between two consecutive activities by summing up all times between activities, except the one which takes the longest:

PU_SUM( "CASES", 
HOURS_BETWEEN(ACTIVITY_LAG("ACTIVITIES"."EVENTTIME"), "ACTIVITIES"."EVENTTIME"),
INDEX_ORDER(HOURS_BETWEEN(ACTIVITY_LAG("ACTIVITIES"."EVENTTIME"), "ACTIVITIES"."EVENTTIME"), ORDER BY ( HOURS_BETWEEN(ACTIVITY_LAG("ACTIVITIES"."EVENTTIME"), "ACTIVITIES"."EVENTTIME") DESC ), PARTITION BY ( "ACTIVITIES"."_CASE_KEY" ))
> 1)

Best
David