Skip to main content

Celonis Product Documentation

COUNT
Description

This function counts the rows of a column per group. It can be applied on columns of any data type.

Use the COUNT DISTINCT function to count only the unique values in a group.

Syntax
 COUNT ( table.column )
NULL handling

NULL values are not counted. If all the values in a group are NULL, the result for this group is 0.

Examples

[1]

Count elements of the column.

Query

Column1

         COUNT ( "Table1"."Column1" )
        

Input

Output

Table1

Column1 : int

3

1

1

2

Result

Column1 : int

4

[2]

Count the number of values grouped by country.

Query

Column1

         "Table1"."Country"
        

Column2

         COUNT ( "Table1"."Values" )
        

Input

Output

Table1

Country : string

Values : int

'US'

3

'DE'

10

'DE'

5

'FR'

5

'US'

4

'US'

3

Result

Column1 : string

Column2 : int

'DE'

2

'FR'

1

'US'

3

[3]

Count the number of values mixed with nulls, grouped by country.

Query

Column1

         "Table1"."Country"
        

Column2

         COUNT ( "Table1"."Values" )
        

Input

Output

Table1

Country : string

Values : int

'FR'

10

'FR'

null

'DE'

null

Result

Column1 : string

Column2 : int

'DE'

0

'FR'

1

See also: