backend.pql_queries.resource_based_queries¶
Queries that can be used to get resource related data from celonis.
Functions¶
|
A query that gets the count of resources from an event log. |
|
A query that gets the count of groups from an event log. |
|
A query that maps activities to their related resources. |
|
Returns the Handover of Work metric. |
|
Returns the Subcontracting metric. |
|
Returns the Working Together metric. |
|
Returns the Similar Activities metric. |
|
Returns the organizational roles. |
Calculates the number of distinct activities. |
|
|
Calculates the activity frequency. |
|
Calculates the number of activity completions. |
|
Calculates the number of case completions. |
|
Calculates the fraction of case completions. |
|
Calculates the average workload. |
|
Calculates the average activity duration. |
|
Calculates the average case duration. |
|
Calculates the interaction between two resources. |
|
Calculates the social position of a resource. |
|
Returns the Group Relative Focus. |
|
Returns" the Group Relative Stake. |
|
Returns the Group Coverage metric. |
|
Returns the Group Member Contribution metric. |
Module Contents¶
- backend.pql_queries.resource_based_queries.get_number_of_resources(celonis: backend.celonis_connection.celonis_connection_manager.CelonisConnectionManager) pandas.DataFrame ¶
A query that gets the count of resources from an event log.
- Parameters:
celonis (CelonisConnectionManager) – the celonis connection
- Returns:
a pandas Dataframe that contains the count of resources
- backend.pql_queries.resource_based_queries.get_number_of_groups(celonis: backend.celonis_connection.celonis_connection_manager.CelonisConnectionManager) pandas.DataFrame ¶
A query that gets the count of groups from an event log.
- Parameters:
celonis (CelonisConnectionManager) – the celonis connection
- Returns:
a pandas Dataframe that contains the count of groups
- backend.pql_queries.resource_based_queries.get_resource_for_activity(celonis: backend.celonis_connection.celonis_connection_manager.CelonisConnectionManager) pandas.DataFrame ¶
A query that maps activities to their related resources.
- Parameters:
celonis (CelonisConnectionManager) – the celonis connection
- Returns:
a pandas Dataframe that contains the mapping between activities to their related resources
- backend.pql_queries.resource_based_queries.get_handover_of_work_values(celonis: backend.celonis_connection.celonis_connection_manager.CelonisConnectionManager) pandas.DataFrame ¶
Returns the Handover of Work metric.
The Handover of Work metric is a dictionary where the keys are tuples of two individuals and the values are the number of times the first individual is followed by the second individual in the execution of a business process.
- Parameters:
celonis (CelonisConnectionManager) – the celonis connection
- Returns:
A DataFrame containing the Handover of Work metric.
- backend.pql_queries.resource_based_queries.get_subcontracting_values(celonis: backend.celonis_connection.celonis_connection_manager.CelonisConnectionManager) pandas.DataFrame ¶
Returns the Subcontracting metric.
The Subcontracting metric is a dictionary where the keys are tuples of two individuals and the values are the number of times the first individual is interleaved by the second individual in the execution of a business process.
- Parameters:
celonis (CelonisConnectionManager) – the celonis connection
- Returns:
A DataFrame containing the Subcontracting metric.
- backend.pql_queries.resource_based_queries.get_working_together_values(celonis: backend.celonis_connection.celonis_connection_manager.CelonisConnectionManager) pandas.DataFrame ¶
Returns the Working Together metric.
The Working Together metric is a dictionary where the keys are tuples of two individuals and the values are the number of times the two individuals worked together to resolve a process instance.
- Parameters:
celonis (CelonisConnectionManager) – the celonis connection
- Returns:
A DataFrame containing the Working Together metric.
- backend.pql_queries.resource_based_queries.get_similar_activities_values(celonis: backend.celonis_connection.celonis_connection_manager.CelonisConnectionManager) pandas.DataFrame ¶
Returns the Similar Activities metric.
The Similar Activities metric is a dictionary where the keys are tuples of two individuals and the values are the similarity score between the two individuals.
- Parameters:
celonis (CelonisConnectionManager) – the celonis connection
- Returns:
A DataFrame containing the Similar Activities metric.
- backend.pql_queries.resource_based_queries.get_organizational_roles(celonis: backend.celonis_connection.celonis_connection_manager.CelonisConnectionManager) pandas.DataFrame ¶
Returns the organizational roles.
The organizational roles are stored as a semi-structured list of activity groups, where each group associates a list of activities with a dictionary of originators and their corresponding importance scores.
- Parameters:
celonis (CelonisConnectionManager) – the celonis connection
- Returns:
A DataFrame containing the organizational roles.
- backend.pql_queries.resource_based_queries.get_number_of_distinct_activities(celonis: backend.celonis_connection.celonis_connection_manager.CelonisConnectionManager, start_time: str, end_time: str, resource: str) int ¶
Calculates the number of distinct activities.
Number of distinct activities done by a resource in a given time interval [t1, t2).
- Parameters:
celonis (CelonisConnectionManager) – The Celonis connection
start_time (str) – The start time of the interval.
end_time (str) – The end time of the interval.
resource (str) – The resource for which to calculate the number of distinct activities.
- Returns:
An integer denoting the number of distinct activities.
- backend.pql_queries.resource_based_queries.get_activity_frequency(celonis: backend.celonis_connection.celonis_connection_manager.CelonisConnectionManager, start_time: str, end_time: str, resource: str, activity: str) float ¶
Calculates the activity frequency.
Fraction of completions of a given activity a by a given resource r during a given time slot [t1, t2), with respect to the total number of activity completions by resource r during [t1, t2).
- Parameters:
celonis (CelonisConnectionManager) – The Celonis connection
start_time (str) – The start time of the interval.
end_time (str) – The end time of the interval.
resource (str) – The resource for which to calculate the activity frequency.
activity (str) – The activity for which to calculate the frequency.
- Returns:
A float indicating the activity frequency of the given activity by the resource in the given time interval.
- backend.pql_queries.resource_based_queries.get_activity_completions(celonis: backend.celonis_connection.celonis_connection_manager.CelonisConnectionManager, start_time: str, end_time: str, resource: str) int ¶
Calculates the number of activity completions.
Number of completions of a given activity by a given resource during a given time slot [t1, t2).
- Parameters:
celonis (CelonisConnectionManager) – The Celonis connection
start_time (str) – The start time of the interval.
end_time (str) – The end time of the interval.
resource (str) – The resource for which to calculate the number of activity completions.
- Returns:
An integer denoting the number of activity completions by the resource in the given time interval.
- backend.pql_queries.resource_based_queries.get_case_completions(celonis: backend.celonis_connection.celonis_connection_manager.CelonisConnectionManager, start_time: str, end_time: str, resource: str) int ¶
Calculates the number of case completions.
Number of completions of a given case by a given resource during a given time slot [t1, t2).
- Parameters:
celonis (CelonisConnectionManager) – The Celonis connection
start_time (str) – The start time of the interval.
end_time (str) – The end time of the interval.
resource (str) – The resource for which to calculate the number of case completions.
- Returns:
An integer denoting the number of case completions by the resource in the given time interval.
- backend.pql_queries.resource_based_queries.get_fraction_case_completions(celonis: backend.celonis_connection.celonis_connection_manager.CelonisConnectionManager, start_time: str, end_time: str, resource: str) float ¶
Calculates the fraction of case completions.
Fraction of completions of a case by a given resource r during a given time slot [t1, t2), with respect to the total number of case completions during [t1, t2).
- Parameters:
celonis (CelonisConnectionManager) – The Celonis connection
start_time (str) – The start time of the interval.
end_time (str) – The end time of the interval.
resource (str) – The resource for which to calculate the fraction of case completions.
- Returns:
A float indicating the fraction of case completions by the resource in the given time interval.
- backend.pql_queries.resource_based_queries.get_average_workload(celonis: backend.celonis_connection.celonis_connection_manager.CelonisConnectionManager, start_time: str, end_time: str, resource: str) float ¶
Calculates the average workload.
Average workload of a given resource r during a given time slot [t1, t2).
- Parameters:
celonis (CelonisConnectionManager) – The Celonis connection
start_time (str) – The start time of the interval.
end_time (str) – The end time of the interval.
resource (str) – The resource for which to calculate the average workload.
- Returns:
A float indicating the average workload of the resource in the given time interval.
- backend.pql_queries.resource_based_queries.get_average_activity_duration(celonis: backend.celonis_connection.celonis_connection_manager.CelonisConnectionManager, start_time: str, end_time: str, resource: str, activity: str) float ¶
Calculates the average activity duration.
The average duration of instances of a given activity completed during a given time slot by a given resource.
- Parameters:
celonis (CelonisConnectionManager) – The Celonis connection
start_time (str) – The start time of the interval.
end_time (str) – The end time of the interval.
resource (str) – The resource for which to calculate the average activity duration.
activity (str) – The activity for which to calculate the average duration.
- Returns:
A float indicating the average duration of the given activity by the resource in the given time interval.
- backend.pql_queries.resource_based_queries.get_average_case_duration(celonis: backend.celonis_connection.celonis_connection_manager.CelonisConnectionManager, start_time: str, end_time: str, resource: str) float ¶
Calculates the average case duration.
The average duration of cases completed during a given time slot in which a given resource was involved.
- Parameters:
celonis (CelonisConnectionManager) – The Celonis connection
start_time (str) – The start time of the interval.
end_time (str) – The end time of the interval.
resource (str) – The resource for which to calculate the average case duration.
- Returns:
A float indicating the average duration of cases completed by the resource in the given time interval.
- backend.pql_queries.resource_based_queries.get_interaction_two_resources(celonis: backend.celonis_connection.celonis_connection_manager.CelonisConnectionManager, start_time: str, end_time: str, resource1: str, resource2: str) float ¶
Calculates the interaction between two resources.
The number of cases completed during a given time slot in which two given resources were involved.
- Parameters:
celonis (CelonisConnectionManager) – The Celonis connection
start_time (str) – The start time of the interval.
end_time (str) – The end time of the interval.
resource1 (str) – The first resource for which to calculate the interaction.
resource2 (str) – The second resource for which to calculate the interaction.
- Returns:
A float indicating the interaction between the two resources in the given time interval.
- backend.pql_queries.resource_based_queries.get_social_position(celonis: backend.celonis_connection.celonis_connection_manager.CelonisConnectionManager, start_time: str, end_time: str, resource: str) float ¶
Calculates the social position of a resource.
The social position is the fraction of resources that interacted with a given resource during a given time slot with respect to the total number of resources that were active during that time slot.
- Parameters:
celonis (CelonisConnectionManager) – The Celonis connection
start_time (str) – The start time of the interval.
end_time (str) – The end time of the interval.
resource (str) – The resource for which to calculate the social position.
- Returns:
A float indicating the social position of the resource in the given time interval.
- backend.pql_queries.resource_based_queries.get_group_relative_focus(celonis: backend.celonis_connection.celonis_connection_manager.CelonisConnectionManager) pandas.DataFrame ¶
Returns the Group Relative Focus.
The Group Relative Focus metric specifies for a given work how much a resource group performed this type of work compared to the overall workload of the group. It can be used to measure how the workload of a resource group is distributed over different types of work, i.e., work diversification of the group.
- Parameters:
celonis (CelonisConnectionManager) – The Celonis connection
- Returns:
A DataFrame containing the Group Relative Focus for each group and activity.
- backend.pql_queries.resource_based_queries.get_group_relative_stake(celonis: backend.celonis_connection.celonis_connection_manager.CelonisConnectionManager) pandas.DataFrame ¶
Returns” the Group Relative Stake.
The Group Relative Stake metric specifies for a given work how much this type of work was performed by a certain resource group among all groups. It can be used to measure how the workload devoted to a certain type of work is distributed over resource groups in an organizational model, i.e., work participation by different groups.
- Parameters:
celonis (CelonisConnectionManager) – The Celonis connection
- Returns:
A DataFrame containing the Group Relative Stake for each group and activity.
- backend.pql_queries.resource_based_queries.get_group_coverage(celonis: backend.celonis_connection.celonis_connection_manager.CelonisConnectionManager) pandas.DataFrame ¶
Returns the Group Coverage metric.
The Group Coverage metric with respect to a given type of work, specifies the proportion of members of a resource group that performed this type of work.
- Returns:
A dictionary where the keys are the names of the resources and the values are dictionaries containing resources and the Group Coverage metric.
- backend.pql_queries.resource_based_queries.get_group_member_interaction(celonis: backend.celonis_connection.celonis_connection_manager.CelonisConnectionManager) pandas.DataFrame ¶
Returns the Group Member Contribution metric.
The Group Member Contribution metric of a member of a resource group with respect to a given type of work specifies how much of this type of work by the group was performed by the member. It can be used to measure how the workload of the entire group devoted to a certain type of work is distributed over the group members.
- Parameters:
celonis (CelonisConnectionManager) – The Celonis connection