Skip to main content

PQL46 (PQL Function Library - CPM 4.6)

INDEX_ACTIVITY_LOOP

Applies to: CELONIS 4.6

Description

The INDEX_ACTIVITY_LOOP operator returns how many times every activity has occurred in direct succession in every case.

Syntax
INDEX_ACTIVITY_LOOP ( activity_table.activity_column )
  • activity_column: The activity column of the activity table.

Result

For every activity in every case a number x, that shows this is the xth occurrence of this particular activity in direct succession within that case.

Parallel processes

Activities in parallel processes will get an index activity loop count with respect to the absolute order, based on the timestamp of the activity.

Example

[1] In this example, case 1 contains a loop of three A-activities. Inside this loop, all activities are indexed accordingly. Case 2 contains a loop of three B-activities, therefore indices 1-2-3 are assigned. All other activities get index 1 since they are not part of an activity loop.

Query

Column1

INDEX_ACTIVITY_LOOP ( "Activities"."ACTIVITY" )

Input

Output

Activities

CASE : INT

ACTIVITY : STRING

TIMESTAMP : DATE

1

'A'

Tue Jan 01 2019 13:00:00.000

1

'B'

Tue Jan 01 2019 13:01:00.000

1

'A'

Tue Jan 01 2019 13:02:00.000

1

'A'

Tue Jan 01 2019 13:03:00.000

1

'A'

Tue Jan 01 2019 13:04:00.000

2

'A'

Tue Jan 01 2019 13:05:00.000

2

'B'

Tue Jan 01 2019 13:06:00.000

2

'B'

Tue Jan 01 2019 13:07:00.000

2

'B'

Tue Jan 01 2019 13:08:00.000

2

'C'

Tue Jan 01 2019 13:09:00.000

Result

Column1 : INT

1

1

1

2

3

1

1

2

3

1

See also: