Table of Contents

Search

  1. Preface
  2. The Transformation Language
  3. Constants
  4. Operators
  5. Variables
  6. Dates
  7. Functions
  8. Creating Custom Functions
  9. Custom Function API Reference

Transformation Language Reference

Transformation Language Reference

STDDEV

STDDEV

Returns the standard deviation of the numeric values you pass to this function. STDDEV is used to analyze statistical data. You can nest only one other aggregate function within STDDEV, and the nested function must return a Numeric datatype.

Syntax

STDDEV(
numeric_value
[,
filter_condition
] )
The following table describes the arguments for this command:
Argument
Required/
Optional
Description
numeric_value
Required
Numeric datatypes. This function passes the values for which you want to calculate a standard deviation or the results of a function. You can enter any valid transformation expression. You can use operators to average values in different ports.
filter_condition
Optional
Limits the rows in the search. The filter condition must be a numeric value or evaluate to TRUE, FALSE, or NULL. You can enter any valid transformation expression.

Return Value

Numeric value.
NULL if all values passed to the function are NULL or if no rows are selected (for example, the filter condition evaluates to FALSE or NULL for all rows).
If the return value is Decimal with precision greater than 15, you can enable high precision to ensure decimal precision up to 38 digits.

Nulls

If a single value is NULL, STDDEV ignores it. However, if all values are NULL, STDDEV returns NULL.
By default, the
PowerCenter Integration Service
treats null values as NULLs in aggregate functions. If you pass an entire port or group of null values, the function returns NULL. However, when you configure the
PowerCenter Integration Service
, you can choose how you want to handle null values in aggregate functions. You can treat null values as 0 in aggregate functions or as NULL.

Group By

STDDEV groups values based on group by ports you define in the transformation, returning one result for each group.
If there is no group by port, STDDEV treats all rows as one group, returning one value.

Examples

The following expression calculates the standard deviation of all rows greater than $2000.00 in the TOTAL_SALES port:
STDDEV( SALES, SALES > 2000.00 )
SALES
2198.0
1010.90
2256.0
153.88
3001.0
NULL
8953.0
RETURN VALUE:
3254.60361129688
The function does not include the values 1010.90 and 153.88 in the calculation because the
filter_condition
specifies sales greater than $2,000.
The following expression calculates the standard deviation of all rows in the SALES port:
STDDEV(SALES)
SALES
2198.0
2198.0
2198.0
2198.0
RETURN VALUE:
0
The return value is 0 because each row contains the same number (no standard deviation exists). If there is no standard deviation, the return value is 0.

0 COMMENTS

We’d like to hear from you!