LINK_FILTER
Description
Warning
To use this feature, Object Link needs to be configured in the data model.
LINK_FILTER
enables case-based recursive filtering on the Object Link graph.
The Object Link configuration connects rows belonging to specified tables, resulting in a virtual graph structure. Each row is represented by a node in the graph. The graph structure is represented by an edge table of directed edges between rows from the tables. This can be defined by using signal columns or by using a dedicated mapping table, which contains all existing edges.
The LINK_FILTER
operator can be used to filter along the edges of the Object Link graph. The user can specify a condition defining the starting point and the direction in which the graph should be traversed to apply the filter.
LINK_FILTER
returns Boolean values and can therefore be used in all places where a condition is expected. Usually it is used as the condition of a FILTER or CASE WHEN statement.
LINK_FILTER
starts a traversal of the graph with the nodes of the graph that fulfill the given condition. All nodes that are passed with the traversal are included in the filter result. The traversal is done in the direction that was specified. Given a filter statement, LINK_FILTER
first maps the filter to cases and then extends the resulting filter to cover all preceding or succeeding cases (according to the Object Link configuration)
Syntax
LINK_FILTER ( filter_expression, {ANCESTORS|DESCENDANTS} [, number_of_hops] )
LINK_FILTER ( BIND_FILTERS ( object_link_table, filter_expression ), {ANCESTORS|DESCENDANTS} [, number_of_hops] )
filter_expression
needs to be a column from the Object Link table.If a
filter_expression
neither belongs to an Object Link table nor is based onLINK_SOURCE/LINK_TARGET
, it can first be pulled to an Object Link table using the BIND_FILTERS operator.ANCESTORS
filters on the row and all ancestors of that row in the Object Link graph, whileDESCENDANTS
filters on the row and all descendants of that row.number_of_hops
(optional) is an INT parameter that specifies how many levels to include in the link traversal process. Everything above this level will be not be included in the result.LINK_FILTER
can be used together with FILTER and CASE WHEN statements.
LINK_FILTER_ORDERED ( filter_expression, {ANCESTORS|DESCENDANTS} [, number_of_hops] )
LINK_FILTER_ORDERED ( BIND_FILTERS ( activity_table, filter_expression ), {ANCESTORS|DESCENDANTS} [, number_of_hops] )
The
ORDERED
version ofLINK_FILTER
considers the order of the activity table based on the timestamps. For example, in contrast to the regular LINK_FILTER, only outgoing links of an activity that takes place after the activity with the incoming link are considered.LINK_FILTER_ORDERED
can only be used with a Signal Link setup.
NULL handling
NULL values in the OUT and IN columns from the Object Link configuration are ignored.
Examples
[1] Example of
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
[2] Example of
![]() | |||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||
|
[3] Example of
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
[4] Example of
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
[5] Example of
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
[6] Example of
| |||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||
|
[7] Example of
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|