Hi, Can anyone help me to calculate time difference between LAST TWO activities in the process where last two activities are not fixed ones. Thanks in advance!
Hi Sivasakthi,
To find the time difference between two activities where the last two activities are not fixed ones, I would suggest using variables so that one can manually assign the desired activity as required.
You can have a view on the front end with an input dropdown for your activity list and build the formula for the same as :
CALC_THROUGHPUT ( FIRST_OCCURRENCE C 'variable1' ] TO FIRST_OCCURRENCE C 'variable2' ] , REMAP_TIMESTAMPS ( "Table1"."TIMESTAMP" , MINUTES ) )
You can find more information here :
Calc_throughput : Link
Variables : Link
Please let me know if i can help you further on this.
Best,
Riddhi
Hi Riddhi, Thanks very much for your response. I will not have the name of the last two activities. ie I need to find time difference for last two activities of all active cases. So I can not pass values thru variables in this scenario. Please suggest if there is an alternate way. Thanks!
Hi @sivasakthi.dhand ,
Hope my answer helps you out.
HOURS_BETWEEN(
PU_LAST(CASE_TABLE, ACTIVITY_EVENTTIME, ACTIVITY_COLUMN=ACTIVITY_LAG(PU_LAST(CASE_TABLE, ACTIVITY_COLUMN, ORDER BY ACTIVITY_EVENTTIME DESC),1)), --Last second activity eventtime.
PU_LAST(CASE_TABLE, ACTIVITY_EVENTTIME) -- last activity eventtime.
)
Do let me know if it works. Apologies if any syntax error.
Regards,
Sachin
Hi @sivasakthi.dhand ,
Hope my answer helps you out.
HOURS_BETWEEN(
PU_LAST(CASE_TABLE, ACTIVITY_EVENTTIME, ACTIVITY_COLUMN=ACTIVITY_LAG(PU_LAST(CASE_TABLE, ACTIVITY_COLUMN, ORDER BY ACTIVITY_EVENTTIME DESC),1)), --Last second activity eventtime.
PU_LAST(CASE_TABLE, ACTIVITY_EVENTTIME) -- last activity eventtime.
)
Do let me know if it works. Apologies if any syntax error.
Regards,
Sachin
Thanks a lot Sachin. Your solution helps out. I simplified as below.
pu_last("Cel_Case",REMAP_TIMESTAMPS ( "Cel_Activities"."event_date", days )) - pu_last("Cel_Case",REMAP_TIMESTAMPS ( ACTIVITY_LAG ( "Cel_Activities"."event_date",1), days ))
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.