Table of Contents

Search

  1. Preface
  2. Function reference
  3. Constants
  4. Operators
  5. Dates
  6. Functions
  7. System variables
  8. Datatype reference

Function Reference

Function Reference

Aggregate functions

Aggregate functions

Aggregate functions return summary values for non-null values in selected fields.
With aggregate functions you can complete the following tasks:
  • Calculate a single value for all rows in a group.
  • Return a single value for each group in an Aggregator object.
  • Apply filters to calculate values for specific rows in the selected fields.
  • Use operators to perform arithmetic within the function.
  • Calculate two or more aggregate values derived from the same source columns in a single pass.
Use aggregate functions in
mapping
tasks only.
The transformation language includes the following aggregate functions:
  • AVG
  • COUNT
  • FIRST
  • LAST
  • MAX (Date)
  • MAX (Number)
  • MAX (String)
  • MEDIAN
  • MIN (Date)
  • MIN (Number)
  • MIN (String)
  • PERCENTILE
  • STDDEV
  • SUM
  • VARIANCE
Use aggregate functions in Aggregator objects only. You can nest only one aggregate function within another aggregate function.
Data Integration
evaluates the innermost aggregate function expression and uses the result to evaluate the outer aggregate function expression.
You cannot nest aggregate functions in advanced mode.
You can set up an Aggregator object that groups by ID and nests two aggregate functions as follows:
SUM( AVG( earnings ) )
where the dataset contains the following values:
ID
EARNINGS
1
32
1
45
1
100
2
65
2
75
2
76
3
21
3
45
3
99
The return value is 186.
Data Integration
groups by ID, evaluates the AVG expression, and returns three values. Then it adds the values with the SUM function to get the result.

0 COMMENTS

We’d like to hear from you!