Filter Expressions
Operators
Intelligence API supports a subset of OData filter operators:
Comparison operators
Operator | Description | Example |
---|---|---|
eq |
Equal | City eq 'Redmond' |
ne |
Not equal | City ne 'London' |
gt |
Greater than | Price gt 20 |
ge |
Greater than or equal | Price ge 10 |
lt |
Less than | Price lt 20 |
le |
Less than or equal | Price le 100 |
in |
Is a member of | City in ('Redmond', 'London') |
Logical operators
Operator | Description | Example |
---|---|---|
and |
Logical and | Price le 200 and Price gt 3.5 |
or |
Logical or | Price le 3.5 or Price gt 200 |
not |
Logical negation | not endswith(Description,'milk') |
Grouping operators
Operator | Description | Example |
---|---|---|
() |
Precedence grouping | (Price eq 5) or (City eq 'London') |
String functions
Function | Example |
---|---|
contains |
contains(CompanyName,'freds') |
endswith |
endswith(CompanyName,'Futterkiste') |
startswith |
startswith(CompanyName,'Alfr') |
Filter Expressions and Types
The filter expressions will be sensitive to the expressions field’s types. Below is a table outlining the supported types and examples of appropriate filter expressions.
Celonis Data Type | Celonis Data Format | Filter Example | Filter results (mapping to PQL) |
String | Standard (No format) | Name eq 'John Doe' |
“TABLE”.“Name” = ‘John Doe’ |
Boolean | True/False | Active eq true |
“TABLE”.“Active”” = 0 |
Yes/No | |||
0/1 | |||
Integer | Standard (No format) | Age eq 10 |
“TABLE”.“Age” = 10 |
Rounded (,.0f) | |||
Percentage (%) | |||
Decimal Number (#.##) | |||
Abbreviated (##.#k) | |||
Float | Standard (No format) | Ratio eq 10.2 |
“TABLE”.“Ratio” = 10.2 |
Rounded (,.0f) | |||
Percentage (%) | |||
Decimal Number (#.##) | |||
Abbreviated (##.#k) | |||
Date | Standard (No format) | Date eq 2015-05-07 |
TO_STRING(“TABLE”.“Date”, FORMAT (‘%Y-%m-%d’)) = ‘2015-05-07’ |
Date (Y-M-D) | |||
Date and Time (Y-M-D H:M) | |||
Time or DateTime or Timestamp | Standard (No format) | Date eq 2023-12-05T15:48:44Z Date eq 2023-12-05T15:48Z Date eq 2023-12-05T15:48+03:00 |
TO_STRING(“TABLE”.“Date”, FORMAT (‘%Y-%m-%d %H:%M:%S’)) = ‘2015-05-07 15:48:44’ TO_STRING(“TABLE”.“Date”, FORMAT (‘%Y-%m-%d %H:%M’)) = ‘2015-05-07 15:48’ |
Date (Y-M-D) | |||
Date and Time (Y-M-D H:M) | |||
Time (H:M) | |||
Using the filterExpr
parameter
To filter data of a single record of a given Knowledge Model
Intelligence API provides an endpoint for getting data from a Knowledge Model Record:
-
Getting Record Data
It uses the
filterExpr
parameter to introduce the filter expressions. For example:filterExpr=active eq true and name eq ‘John Doe’
The field identifier is the Celonis Studio attribute ID and is case-sensitive . Also, Intelligence API supports multi-parameter values, which will be handled by concatenating the filter expressions with the and operator. So, the previous filter expression can be also sent like this:filterExpr=active eq true&filterExpr=name eq ‘John Doe’
To filter data of any record and/or KPI of a given Knowledge Model
Intelligence API also provides an endpoint to get data from different records of a Knowledge Model and combine them with KPIs (Key Performance Indicators):
-
Getting Knowledge Model Data
It uses the
filterExpr
parameter to introduce filter expressions, providing greater flexibility when querying different data within the Knowledge Model. To achieve this, you must specify both the record and the field to filter, allowing you to combine fields from different records within the same Knowledge Model. For example:filterExpr=activities.name eq ‘Release Order’ and users.active eq true
The field identifier is the Celonis Studio record ID and attribute ID which are case-sensitive . Also, Intelligence API supports multi-parameter values, which will be handled by concatenating the filter expressions with the and operator. So, the previous filter expression can be also sent like this:filterExpr=activities.name eq ‘Release Order’&filterExpr=users.active eq true