Skip to main content

Celonis Product Documentation

ACTIVITY_TABLE
Description

ACTIVITY_TABLE allows to refer to the activity table in the data model without using its exact table name. This operator is helpful in data models with multiple activity/case tables.

This function returns a reference to an activity table. The result of this function can then be used at all places where table names are accepted.

Syntax
 ACTIVITY_TABLE ( [ expression ] )
  • When an expression that involves a column of an activity table is passed as an argument, the activity table connected to that column is referenced.

  • When no argument is passed, the default activity table in the data model is referenced.

Examples

[1]

In this example, the data model contains one activity and one case table. By using a column reference as the input expression, we refer to the case table and query one of its columns:

Query

Column1

         ACTIVITY_TABLE("Activities"."Activity")."ACTIVITY"
        

Input

Output

Activities

CASE_ID : string

ACTIVITY : string

TIMESTAMP : date

'1'

'A'

Wed Jan 01 2020 00:00:00.000

'1'

'B'

Thu Jan 02 2020 00:00:00.000

'2'

'A'

Wed Jan 01 2020 00:00:00.000

'2'

'C'

Thu Jan 02 2020 00:00:00.000

'3'

'D'

Wed Jan 01 2020 00:00:00.000

Cases

CASE_ID : string

NAME : string

'1'

'C1'

'2'

'C2'

'3'

'C3'

Foreign Keys

Cases.CASE_ID

Activities.CASE_ID

Result

Column1 : string

'A'

'B'

'A'

'C'

'D'

[2]

In this example, the data model contains one activity and one case table. By using an activity table reference as the input expression and COUNT_TABLE operator, we count the total number of rows in the activity table:

Query

Column1

         COUNT_TABLE ( ACTIVITY_TABLE ( "Activities"."ACTIVITY" ) )
        

Input

Output

Activities

CASE_ID : string

ACTIVITY : string

TIMESTAMP : date

'1'

'A'

Wed Jan 01 2020 00:00:00.000

'1'

'B'

Thu Jan 02 2020 00:00:00.000

'2'

'A'

Wed Jan 01 2020 00:00:00.000

'2'

'C'

Thu Jan 02 2020 00:00:00.000

'3'

'D'

Wed Jan 01 2020 00:00:00.000

Cases

CASE_ID : string

NAME : string

'1'

'C1'

'2'

'C2'

'3'

'C3'

Foreign Keys

Cases.CASE_ID

Activities.CASE_ID

Result

Column1 : int

5

[3]

In this example, the data model contains one activity and one case table. By passing no arguments to the ACTIVITY_TABLE operator, we refer to the default activity table. Then, the total number of rows of the activity table is queried:

Query

Column1

         COUNT_TABLE ( ACTIVITY_TABLE ( ) )
        

Input

Output

Activities

CASE_ID : string

ACTIVITY : string

TIMESTAMP : date

'1'

'A'

Wed Jan 01 2020 00:00:00.000

'1'

'B'

Thu Jan 02 2020 00:00:00.000

'2'

'A'

Wed Jan 01 2020 00:00:00.000

'2'

'C'

Thu Jan 02 2020 00:00:00.000

'3'

'D'

Wed Jan 01 2020 00:00:00.000

Cases

CASE_ID : string

NAME : string

'1'

'C1'

'2'

'C2'

'3'

'C3'

Foreign Keys

Cases.CASE_ID

Activities.CASE_ID

Result

Column1 : int

5

[4]

In this example, MERGE_EVENTLOG is used to combine two activity tables into one. We can use ACTIVITY_TABLE to get the resulting merged activity table and then use COUNT_TABLE to get the number of rows in the merged activity table:

Query

Column1

         COUNT_TABLE ( ACTIVITY_TABLE ( MERGE_EVENTLOG ( "ACTIVITIES_BKPF"."ACTIVITY" , "ACTIVITIES_BSEG"."ACTIVITY" ) ) )
        

Input

Output

ACTIVITIES_BKPF

CASE_ID : string

ACTIVITY : string

TIMESTAMP : date

'C1'

'A'

Wed Jan 01 2020 03:00:00.000

ACTIVITIES_BSEG

CASE_ID : string

ACTIVITY : string

TIMESTAMP : date

'D1'

'X'

Wed Jan 01 2020 01:00:00.000

'D1'

'Y'

Thu Jan 02 2020 01:00:00.000

'D2'

'X'

Wed Jan 01 2020 02:00:00.000

'D2'

'Z'

Thu Jan 02 2020 02:00:00.000

BKPF

CASE_ID : string

'C1'

BSEG

CASE_ID : string

SUPER_CASE_ID : string

'D1'

'C1'

'D2'

'C1'

Foreign Keys

BKPF.CASE_ID

ACTIVITIES_BKPF.CASE_ID

BSEG.CASE_ID

ACTIVITIES_BSEG.CASE_ID

BKPF.CASE_ID

BSEG.SUPER_CASE_ID

Result

Column1 : int

5