Skip to main content

PQL - Process Query Language

Description

The Process Query Language (PQL) is the analytical backbone of the Celonis platform, and empowers you to translate complex business questions into actionable process insights.

PQL is purpose-built to transform data into specific actions by helping you:

  • Measure process health and define custom KPIs.

  • Pinpoint bottlenecks across your process flow.

  • Standardize analytical logic across all analyses and automations.

PQL's unique features are the composability of functions and the support for specialized Process Mining operators that allow you to quickly calculate metrics directly from your event log based business data. These functions enable cross-table calculations across your entire data model, a capability that is very tedious and error-prone with standard SQL. PQL also natively supports Object-Centric Process Mining (OCPM).

Tip

Object-Centric Process Mining (OCPM) involves analyzing processes that span multiple related business objects simultaneously (like an Order, an Invoice, and a Delivery). For a deeper dive into OCPM and how to leverage its advantages, see OCPM Perspective.

PQL vs SQL: What are the differences

While PQL offers a familiar syntax for users with SQL experience, it fundamentally differs from traditional SQL by prioritizing process context and data integrity over database manipulation. By abstracting away traditional database operations to focus strictly on process analytics, PQL evaluates queries against the Celonis data modeldefining case-level and activity-level relationships through expressions that are column-based and easily composable. These design choices optimize analysis performance and stability while ensuring that queries remain grounded in the specific structural logic of the business process.

While PQL shares syntax with SQL, it differs along key strategic dimensions to optimize for data analytics with a focus on Process Mining:

  • Domain-Specific: PQL offers specialized Process Mining operators that are not available in SQL. This enables you to focus on behavioral patterns and performance metrics.

  • No Data Manipulation Language (DML): PQL is a read-only querying language. All data updates must originate from source systems, ensuring data integrity.

  • No Data Definition Language (DDL): The data model is created via a visual editor. This simplifies authoring, allowing you to focus on analysis rather than schema design.

  • Language Scope: PQL does not support all operators available in SQL; development is driven strictly by customer requirements for target use cases. This focuses the language on efficient process analysis.

Getting started with PQL

This section contains resources to help get you started with PQL.

PQL in practice

PQL statements are essentially formulas that define a single value, metric, or filter for an analysis. Unlike SQL, which requires you to define data sources with SELECT...FROM..WHERE...JOIN...ON..., PQL statements omit these clauses because the data model (tables and joins) is already set up within the Celonis platform. Your focus shifts entirely to the calculation logic that answers a business question.

The statements fall into the following main categories Basic data retrieval and nested aggregation and Specialized process operators. The following sections describe both.

Tip

By leveraging both basic functions and specialized operators, you can transform complex business questions into quantifiable analytical metrics. The PQL documentation contains extensive examples and use cases showing how combining various operators, complex process related questions can be answered. For more information, see Examples and Use Cases.

Basic data retrieval and nested aggregation

PQL begins with simple aggregation, similar to SQL. The true power lies in Pull-Up (PU) functions, which allow arbitrarily nested aggregation across different data levels. This simplifies complex, multi-level analysis well beyond standard SQL capabilities. For example:

Category

PQL Example Statement

Result and Purpose

Simple Aggregation

SUM("Book"."PageCount")

The total number of pages for all Books in the dataset.

Filtering

FILTER "Book"."Title" = 'Invoice Process Guidelines'

Only includes data related to the book Invoice Process Guidelines in the calculation.

Pull-Up Aggregation

SUM( PU_COUNT ( "Book", "Chapter"."Title" ) )

Calculates the total number of Chapters of all Books in the dataset, linking two distinct tables.

Specialized process operators

These unique PQL functions are purpose-built for the chronological nature of event log data, enabling complex process-centric metrics that simplify process mining logic.

Category

PQL Example Statement

Result and Purpose

Process Metric

CALC_REWORK ( "e_celonis_Event"."Activity" )

Counts the number of times an activity was repeated within a case (rework), a core process metric.

OCPM

CALC_THROUGHPUT ( "o_celonis_Object", FIRST_OCCURRENCE [ 'e_celonis_ModifyObject' ] TO LAST_OCCURRENCE [ 'e_celonis_ModifyObject' ] , DAYS )

Calculate the days between the first and last occurrence of a specific event type (e_celonis_ModifyObject), enabling Object-Centric Process Mining.

PQL optimization

When working with PQL, it is important to understand how the complexity of your PQL queries can affect results and performance. For more information on optimizing your PQL queries, see PQL performance optimization guide.

Celonis Academy PQL training

To deepen your understanding of PQL, we suggest exploring PQL training offered by the Celonis Academy. It offers guided learning paths, hands-on exercises, and advanced training dedicated to PQL and process analytics, from beginner to expert level.

If you are just starting out with PQL, we suggest the following courses:

For intermediate users, there are multiple courses available that build on core concepts.

For experienced users, there are expert courses focused on advanced PQL techniques and solving real world use cases.