Skip to main content

Celonis Product Documentation

PU_STDEV
Description

Calculates the standard deviation of the specified source column per each group of samples per group in the given target table. The standard deviation is using the "n-1" method. Standard deviation can be applied to INT or FLOAT columns.

Syntax
 PU_STDEV ( target_table, source_table.column [, filter_expression] )
  • target_table: The table to which the aggregation result should be pulled. This can be:

  • source_table.column: The column which should be aggregated for every row of the target_table.

  • filter_expression (optional): An optional filter expression to specify which values of the source_table.column should be taken into account for the aggregation.

NULL handling

If no value in the source table column exists for the element in the target table (either because all values of the source table are filtered out, or because no corresponding value exists in the first place), NULL will be returned. NULL values in the source table column are treated as if the row does not exist.

Examples

[1]

This example shows a calculation of the standard variance of the values from the "Table"."values" column per row of table "Country". If we have a table of countries (DE, FR, US) and values in a corresponding table, standard variances are calculated for all samples in the corresponding table belonging to one country, i.e. standard variance for all samples belonging to DE, standard variance for US, and so on.

Query

Column1

         "Country"."name"
        

Column2

         PU_STDEV ( Country , "Table"."values" )
        

Input

Output

Country

name : string

'DE'

'FR'

'US'

Table

country : string

values : float

'US'

10.0

'DE'

40.0

'DE'

50.0

'FR'

50.0

'US'

20.0

'US'

30.0

Foreign Keys

Country.name

Table.country

Result

Column1 : string

Column2 : float

'DE'

7.071

'FR'

0.0

'US'

10.0

[2]

This example shows a calculation of the standard variance with null values, grouped by country.

Query

Column1

         "Country"."name"
        

Column2

         PU_STDEV ( Country , "Table"."values" )
        

Input

Output

Country

name : string

'DE'

'FR'

'US'

Table

country : string

values : float

'DE'

10.0

'DE'

null

'DE'

20.0

'FR'

null

'FR'

null

'US'

10.0

'US'

20.0

'US'

30.0

Foreign Keys

Country.name

Table.country

Result

Column1 : string

Column2 : float

'DE'

7.071

'FR'

null

'US'

10.0

[3]

This example shows a calculation of the standard variance of the values from the "Table"."values" column per row of table "Country", but only consider the cases values are greater than 15.

Query

Column1

         "Country"."name"
        

Column2

         PU_STDEV ( Country , "Table"."values" , "Table"."values" > 15 )
        

Input

Output

Country

name : string

'DE'

'FR'

'US'

Table

country : string

values : float

'US'

10.0

'DE'

10.0

'DE'

20.0

'FR'

14.0

'DE'

50.0

'FR'

50.0

'US'

15.0

'DE'

5.0

'US'

20.0

'FR'

16.0

'US'

30.0

Foreign Keys

Country.name

Table.country

Result

Column1 : string

Column2 : float

'DE'

21.213

'FR'

24.041

'US'

7.071

[4]

PU-functions can be used in a FILTER. In this example, the company codes are filtered such that the corresponding standard variance of case table value is greater than 150.

Query

Filter

         FILTER PU_STDEV ( "companyDetail" , "caseTable"."value" ) > 150;
        

Column1

         "companyDetail"."companyCode"
        

Input

Output

caseTable

caseId : int

companyCode : string

value : float

1

'001'

600.0

2

'001'

400.0

3

'001'

200.0

4

'002'

300.0

5

'002'

300.0

6

'003'

200.0

companyDetail

companyCode : string

country : string

'001'

'DE'

'002'

'DE'

'003'

'US'

Foreign Keys

caseTable.companyCode

companyDetail.companyCode

Result

Column1 : string

'001'

See also: