Skip to main content

PQL47 (PQL Function Library - CPM 4.7)

DOMAIN_TABLE

Applies to: CELONIS 4.5 CELONIS 4.6 CELONIS 4.7

Description

The DOMAIN_TABLE function can be used to create a temporary table from various column(s), which can be used as a child table inside all PU functions.

It is not possible to use the same table as the parent and the child table in a PU function. However, the DOMAIN_TABLE function can be used to create a temporary table from various column(s). These column(s) must have a common parent table to which the columns are joined to. The column for the PU function has to be from a common parent table of the specified column(s) for the temporary table. Further documentation about parent and child tables can be found in Join functionality.

The temporary table created by DOMAIN_TABLE contains all unique combinations of values from the specified column(s) existing in the result of joining these column(s) to their closest common parent table. The resulting temporary table is a child table of the closest common parent table of the specified column(s).

Syntax
DOMAIN_TABLE ( table.column, ... )
Examples

[1] For each case ID, calculate the number of times the associated company code is contained in the table using DOMAIN_TABLE.

Query

Column1

"caseTable"."caseId"

Column2

PU_COUNT ( DOMAIN_TABLE ( "caseTable"."companyCode" ) , "caseTable"."companyCode" )

Input

Output

caseTable

caseId : INT

companyCode : STRING

value : INT

1

'001'

600

2

'001'

400

3

'001'

200

4

'002'

300

5

'002'

300

6

'003'

200

Result

Column1 : INT

Column2 : INT

1

3

2

3

3

3

4

2

5

2

6

1

[2] Filter on all cases where the associated company code occurs less than three times in the table.

Query

Filter

FILTER PU_COUNT ( DOMAIN_TABLE ( "caseTable"."companyCode" ) , "caseTable"."companyCode" ) < 3;

Column1

"caseTable"."caseId"

Column2

PU_COUNT ( DOMAIN_TABLE ( "caseTable"."companyCode" ) , "caseTable"."companyCode" )

Input

Output

caseTable

caseId : INT

companyCode : STRING

value : INT

1

'001'

600

2

'001'

400

3

'001'

200

4

'002'

300

5

'002'

300

6

'003'

200

Result

Column1 : INT

Column2 : INT

4

2

5

2

6

1

[3] In this example, the activity table is filtered on all entries that happened on a day with more than three actvities. For this, the DOMAIN_TABLE of all days in the input table is created, and the number of activities for each distinct day is calculated with PU_COUNT. The PU_COUNT result is then compared to '3' in the FILTER query.

Query

Filter

FILTER
    PU_COUNT ( DOMAIN_TABLE ( ROUND_DAY ( "Activities"."timestamp" ) ) , "Activities"."activity" )
    >
    3;

Column1

"Activities"."case"

Column2

"Activities"."activity"

Column3

"Activities"."timestamp"

Input

Output

Activities

case : INT

activity : STRING

timestamp : DATE

1

'A'

Wed Jan 01 2020 01:00:00.000

1

'B'

Thu Jan 02 2020 02:00:00.000

1

'C'

Fri Jan 03 2020 03:00:00.000

2

'A'

Wed Jan 01 2020 01:00:00.000

2

'B'

Thu Jan 02 2020 02:00:00.000

3

'C'

Thu Jan 02 2020 03:00:00.000

3

'D'

Thu Jan 02 2020 04:00:00.000

Result

Column1 : INT

Column2 : STRING

Column3 : DATE

1

'B'

Thu Jan 02 2020 02:00:00.000

2

'B'

Thu Jan 02 2020 02:00:00.000

3

'C'

Thu Jan 02 2020 03:00:00.000

3

'D'

Thu Jan 02 2020 04:00:00.000

See also: