Skip to main content

Hello,

I need a Help on a KPI about OTC .

 

I want to calculate time by hours between,

(Cases which goes through "Lead Status Set To: Open" and does not go throught "Lead Status Set To : Assigned".) and current time.

 

Or can you say what is wrong with my code ?

 

HOURS_BETWEEN (

 CASE

  WHEN MATCH_ACTIVITIES ( NODE 'Activity Status Set To: Open' ] ) and NOT MATCH_ACTIVITIES ( NODE ( 'Activity Status Set To: Assigned' ] ) THEN "ACTIVITIES"."EVENTTIME"

  ELSE

   -TODAY ( )

 END ,

 TODAY ( )

)

Hello Ömer,

 

Please take a look at MATCH_Activity function documentation and examples (https://help.celonis.cloud/help/display/CIBC/MATCH_ACTIVITIES) for correct syntax, you have multiple errors (i.e. not including activity column and not checking for =1 ).

 

On top, I don't completely understand what time calculation you are trying to make.

The hours between today and what time? The case creation date? the case finish date?

On your code you are using "ACTIVITIES"."EVENTTIME", this means that for a given case it will return many different timestamps (one per activity that it has) and therefore it won't be able to make a calculation with Today(), in fact if you are calculating HOUR_BETWEEN so it is probably more correct to use HOURS_NOW() instead of TODAY(), as TODAY() only returns date, not time.

 

Hope this guidelines help you accomplish your goals.

 

Best regards,


Reply