Skip to main content

Celonis Product Documentation

Views Filters

Introduction to Filters on Views

One of the most powerful capabilities of the EMS and the PQL engine is data filtering using Filters. Filters provide a way to select only those data records that match certain criteria. Filters are used in various places and EMS services.

You can store and maintain Filters either in a Knowledge Model, so they can be easily reused and managed in one place, or in a View. In general, we recommend defining and maintaining Filters on a Knowledge Model level and calling them on Views or View components. However, you can also define and maintain Filters within a View configuration (e.g. for quick changes or testing out a Filter).

There are four levels of filters effective for views

  • Data Models filters (Data Permission on Data Model Level) - The best way to filter by user access rights per user.

  • Global Filters in the Knowledge Model - Similar to Load Script filters in Analysis.

  • View Filters - Filtering the whole view, allowing for variable interaction.

  • Component Filters - Filtering one component, also allowing for variable interaction.

Configuring Filters on Views
Global Filters in the Knowledge Model

Filter definition in the KM

 - id: COUNTRY_FILTER
   displayName: "Country filter"
   description: "Filters down to DE and US data"
   pql: FILTER "TABLE"."Country" IN ('DE','US')
   global: true

Will act as a load script in the analysis by being applied to all queries sent through this Knowledge Model.

On View Level

To set a filter on the whole Views, add it to the root level in the View configuration. You will have to define the filter in the KM to use it on the View.

metadata: []
layout: []
components: []
filters:
  - id: FILTER_FROM_KM 
    visible: true
    editable: false

Making filters visible and editable.

If visible is set to true, the user of your View in Apps will see the filter applied on the View.

If editable is set to true, the user of your View in Apps will be able to clear the set filter temporarily.

You can only set a filter editable when visible is set to true, otherwise the filter chip would not be shown and thus the user can also not interact with it.

By default, visible and editable are set but you can change this either using the visual or YAML editor.

To change the filter settings

  • go to a View in Studio

  • Enter the edit mode

  • hover over the filter chip you want to adjust

  • Click the pen icon

    Bildschirmfoto_2022-06-01_um_11_30_54.png
Definition in the Knowledge Model:
Definition in the Knowledge Model:
metadata: []
kpis: []
...
filters:
  - id: FILTER_FROM_KM 
    description: Internal description for View Creators
    displayName: DisplayName set in Knowledge Model
    pql: FILTER ROUND(DAYS_BETWEEN(TODAY(),ADD_DAYS(PU_LAST("BSEG","_CEL_AP_ACTIVITIES"."EVENTTIME","_CEL_AP_ACTIVITIES"."ACTIVITY_EN" = 'Due Date passed'
 ),-1))) < 0;

Filters can also be set per component. This allows for flexibility in your View. To set a filter for a component, add it on the same level as the component id.

components:
  - id: myKpi
    type: kpi-list
    settings:
      name: My KPI List
    data:
      type: tile
      kpis:
        - kpi: NUMBER_OF_INVOICES
        - kpi: ON_TIME_PAYMENT_RATIO
    filters: 
      - id: FILTER_FROM_KM

In the example above, the Filter gets applied for the component myKpi. However, other components of the same View are not filtered.

How are filters shown on Views?

The permanent filters applied on View level are by default visible to you and your end users on the View. The filters appear next to each other in a filter bar right below the title of the View. They are represented by a filter chip with an orange colour-coding. In case the View creator has set visible and editable to true, the filter chip can be removed temporarily and the View shows unfiltered data. However, after a refresh of the View, the permanent View filter is applied back again.

Bildschirmfoto_2022-06-01_um_11_37_56.png

Next to these permanent view filters, end users can also create temporary filters by interacting with components of the view. These filters are not saved across users. They are represented by blue filter chips. These filters can be generated by the end-user interacting with View components such as dropdowns, KPI lists, charts, tables and more. On hover a remove button appears and the temporary filter is cleared again. It can only be reset through interacting with a component again.

Bildschirmfoto_2022-06-01_um_11_41_36.png
Filtering with variables (input) that are strings

Remember when creating PQL filters that the PQL engine requires strings to be wrapped in single quotes ('Create Invoice'). The input variable will save strings without single quotes (Create Invoice). Therefore you should create PQL like this:

pql: "FILTER PROCESS NOT EQUALS '${ProcesStep}';"
Conditional filtering with KM filters

Also, you can apply filters based on conditions. This can be used to filter your components once a certain action has taken place e.g. a KPI was selected. In this case, you can check if your VARIABLE has an expected value then apply a KM filter (please ensure the KM filter ids are matching).

id: ${ (VARIABLE === 'EXPEXTED_VARIABLE_VALUE' && 'KM_FILTER_ID')}

or

id: ${(VARIABLE === 'EXPEXTED_VARIABLE_VALUE1' && 'KM_FILTER_ID1')  ||
      (VARIABLE ===   'EXPEXTED_VARIABLE_VALUE2' && 'KM_FILTER_ID2') ||
      (VARIABLE === 'EXPEXTED_VARIABLE_VALUE3' && 'KM_FILTER_ID3')  || 
      (VARIABLE === 'EXPEXTED_VARIABLE_VALUE4' && 'KM_FILTER_ID4')  || 
      'KM_FILTER_FALLBACK'}
Additional Use Case: Carry filters into another view

If you want users to go from one view to the next whilst keeping their existing filters, please refer to the button component (open view with "carryFilters") to provide a clear user path.