Skip to main content

Celonis Product Documentation

ARGUMENT_COUNT
Description

ARGUMENT_COUNT counts the number of arguments (i.e., constants or expressions) passed to it.

ARGUMENT_COUNT returns an INT constant indicating the number of arguments passed to it. If no arguments were passed to ARGUMENT_COUNT, it returns 0. The provided arguments can be static or non-static.

Syntax
 ARGUMENT_COUNT ( [ Expression [ , ... ] ] )
  • Expression: Zero or more arguments to be counted.

Examples

[1]

Count three constant arguments.

Query

Column1

         ARGUMENT_COUNT ( 1 , 2 , 3 )
        

Input

Output

Result

Column1 : int

3

[2]

Count two expression arguments.

Query

Column1

         ARGUMENT_COUNT ( "Table"."Column" , MULTI CASE WHEN "Table"."Column" = 0 THEN 'Zero' ELSE 'Not Zero' END )
        

Input

Output

Result

Column1 : int

2

[3]

Passing no argument to ARGUMENT_COUNT returns 0.

Query

Column1

         ARGUMENT_COUNT ( )
        

Input

Output

Result

Column1 : int

0

[4]

Count expression and constant arguments.

Query

Column1

         ARGUMENT_COUNT ( 1 , 2 , "Table"."Column" )
        

Input

Output

Result

Column1 : int

3

[5]

Count static expression and constant arguments.

Query

Column1

         ARGUMENT_COUNT ( 1 , 2 , STATIC CASE WHEN ARGUMENT_COUNT ( 1 , 2 ) = 0 THEN 1 ELSE 2 END )
        

Input

Output

Result

Column1 : int

3