MERGE_EVENTLOG
Applies to: CELONIS 4.7
Description
MERGE_EVENTLOG merges two columns of the same type from two activity tables into one common column. The sorting of entries is based on timestamps.
Given two columns of the same type from two activity tables whose case tables are connected directly or indirectly, the MERGE_EVENTLOG
operator computes one common (internal) table, containing the merged result of the two input columns. In general, there are two scenarios how the activity tables can be linked in the data model. The following section describes these two scenarios. Thereby, the direction of the merge is defined by the order of the input columns. The content of the second column is always merged into the corresponding cases of the first input column. The resulting (internal) table is joined to the case table of the first input column.
1:n Scenario
Given two activity tables whose case tables are connected directly or indirectly via a 1:n relationship, MERGE_EVENTLOG
computes one combined (internal) table ('Merge Table') sorted by timestamp. The resulting table is always joined to the case table of the first input column. If the first input column is e.g. from 'Activity Table 1', the resulting 'Merge Table' is joined to 'Case Table 1'.
The two activity tables can also share one case table like shown in the following picture.
n:m Scenario
In the following example, two activity tables 'Activity Table Left' and 'Activity Table Right' and their corresponding case tables 'Case Table Left' and 'Case Table Right' are given. The case tables have a n:m relationship, which is modeled via two 1:n relationships and an intermediate table 'Fact Table Mid'. MERGE_EVENTLOG
computes one combined (internal) table that is joined to the case table of the first input column. If the first input column is e.g. from 'Activity Table Left', the resulting (internal) 'Merge Table' is joined to 'Case Table Left'.
Syntax
MERGE_EVENTLOG ( table1.column1 , table2.column1 )
table1.column1: Column from an activity table.
table2.column1: Column from an activity table.
NULL handling
If there is no corresponding entry for a case in the case table, this case will be ignored.
If in the mapping of the cases the source case id is NULL, the target case will still be in the result table.
If the value of the case column of a row is NULL, the row will be ignored.
If the value of the timestamp column is NULL, the row will be ignored.
If the value of an activity column is NULL, the row will be ignored.
Peculiarities
If there is a case entry in the case table but no corresponding activity with this case id in the target table (1 - side), then a case id for the result of the merge will be generated. If there is a case entry in the case table but no corresponding activity with this case id in the target table (n - side), then the joined items won't be merged.
Examples
[1] This example scenario contains two activity tables ACTIVITIES_BSEG and ACTIVITIES_BKPF joined to their corresponding case tables BSEG and BKPF. The relationship between BSEG and BKPF is n:1. In the example query, the activity column from table ACTIVITIES_BSEG is the first input parameter. Therefore, the activities from table ACTIVITIES_BKPF are merged into the corresponding cases of BSEG. The resulting (internal) table derived from the query is joined to BSEG.
|
[2] This example scenario contains two activity tables ACTIVITIES_BSEG and ACTIVITIES_BKPF joined to their corresponding case tables BSEG and BKPF. The relationship between BSEG and BKPF is n:1. In the example query, the activity column from table ACTIVITIES_BKPF is the first input parameter. Therefore, the activities from table ACTIVITIES_BSEG are merged into the corresponding cases of BKPF. The resulting (internal) table derived from the query is joined to BKPF.
|
[3] In this scenario, the two case tables 'CASE_TABLE_RIGHT' and 'CASE_TABLE_LEFT' are in a n:m relationship that is modeled via two 1:n relationships and the intermediate table 'LEFT_TO_RIGHT'. By using
|
[4] Like in the previous example, the two case tables 'CASE_TABLE_RIGHT' and 'CASE_TABLE_LEFT' are in a n:m relationship that is modeled via two 1:n relationships and the intermediate table 'LEFT_TO_RIGHT'. This time,
|