Skip to main content
Solved

How to calculate automation rate in PQL?

  • Mar 22, 2023 4:53 PM UTC
  • 2 replies
  • 135 views

How to calculate automation rate in PQL?

Best answer by andré.tafur

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.

View original

2 replies

andré.tafur
Level 8
Forum|alt.badge.img+19
  • Level 8
  • Answer
  • Mar 22, 2023 7:39 PM UTC

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:)