FILTER
Applies to: CELONIS 4.0 CELONIS 4.2 CELONIS 4.3 CELONIS 4.4 CELONIS 4.5 CELONIS 4.6 CELONIS 4.7
Description
Filters can be defined as Analysis filters, Sheet filters or Component filters. If a query is sent to Celonis, all active filters are propagated to the requested table(s). Multiple filters on a table are merged together by a logical AND.
Filter propagation
Filter propagation is necessary if there are one or more tables on which a filter is applied, which are not the same as the result table. In that case Celonis propagates the filters to the result table, along the specified join graph. For more information on the join graph see Joins).
Stable filter
All filters in Celonis are stable. Stable in this context means that filters don't interfere with each other. As a result of this, the order of the filters doesn't matter. For example:
FILTER table.col > 400; FILTER table.col < 600;
returns the same as
FILTER table.col < 600; FILTER table.col > 400;
Filter stability is also the reason why Celonis doesn't support filters on aggregations, because they would not be stable. For example:
FILTER table.col > 400; FILTER AVG(table.col) < 400;
can return a different result than
FILTER AVG(table.col) < 400; FILTER table.col > 400;
Syntax
FILTER [FORCED] condition;
NULL handling
Applying a filter which compares a column against NULL or non-NULL always returns an empty result. To filter on all non-NULL values use the ISNULL function. NULL represents an unknown value. Celonis can not be sure if two unknown values are not the same.
Forced filter
If a regular filter is set as a sheet or component filter, the affected Dropdown and Button Dropdown components still show all available values. If only those values which respect the filter should be displayed and selectable, a forced filter can be used. Analysis filters are forced by default.
Example
Dropdown component using this regular sheet or component filter:
FILTER "Table"."Country" IN ('DE','US');
All values are available in the dropdown menu. Values which do not match the filter condition are displayed in gray color.
Dropdown component using this forced sheet or component filter:
FILTER FORCED "Table"."Country" IN ('DE','US');
Only values which match the filter condition are available.
Examples
[1] Example where one filter is applied to the query. The filter condition excludes the second input row. |
[2] Example where one filter is applied to the query. The filter condition excludes the second input row. |
[3] Example where two filters are applied to the query. Both filter conditions are merged together by a logical AND. The first filter condition excludes the second input row, and the second filter condition excludes the first input row. Therefore, only the third row appears in the result. |
[4] Example where one filter is applied to the query. The SUM aggregate function is applied after the filter has been applied to the input table. |
[5] Example where two filters are applied to the query. Both filter conditions are merged together by a logical AND. The first filter condition excludes the first and third input row, and the second filter condition excludes the second and third input row. Therefore, the result is empty. |
[6] Example of two joined tables where one filter is applied to the query. The filter condition excludes the last row of the companyDetail input table, therefore, the last two rows of the caseTable are excluded.
|
[7] Example of two joined tables where one filter is applied to the query. The filter condition excludes the last four rows of the caseTable.
|
[8] Example where DATE columns are being compared to DATE constants:
|
[9] Example where we filter for DATE values from the last two weeks - and implicitly including possible timestamps in the future - by using a combination of ADD_DAYS and TODAY.
|
[10] Applying a filter which compares a column against null always returns an empty result. |
Note
Comparison with NULL always returns NULL. To check for NULL values, please use <value> IS NULL or ISNULL(<value>)=1.
[11] Applying a filter which compares a column against not null always returns an empty result.
|
Note
Comparison with NULL always returns NULL. To check for NULL values, please use <value> IS NULL or ISNULL(<value>)=1.