Skip to main content
How to calculate automation rate in PQL?

Hi,

 

Usually you need to include a User Type column in your Activity Table to distinguish if the activity was executed by a human user or if it was executed by automations, with this requirement you could use the following PQL:

 

AVG(CASE WHEN ISNULL("ACTIVITY_TABLE"."USER_TYPE") = 1 THEN NULL

WHEN "ACTIVITY_TABLE"."USER_TYPE" IN(<%=automatic_users%>) THEN 1.0 ELSE 0.0 END)

 

Hope it helps.


Hi,

 

Usually you need to include a User Type column in your Activity Table to distinguish if the activity was executed by a human user or if it was executed by automations, with this requirement you could use the following PQL:

 

AVG(CASE WHEN ISNULL("ACTIVITY_TABLE"."USER_TYPE") = 1 THEN NULL

WHEN "ACTIVITY_TABLE"."USER_TYPE" IN(<%=automatic_users%>) THEN 1.0 ELSE 0.0 END)

 

Hope it helps.

Thank you:)


Reply