Table of Contents

Search

  1. Preface
  2. Introduction to Informatica Data Engineering Integration
  3. Mappings
  4. Mapping Optimization
  5. Sources
  6. Targets
  7. Transformations
  8. Python Transformation
  9. Data Preview
  10. Cluster Workflows
  11. Profiles
  12. Monitoring
  13. Hierarchical Data Processing
  14. Hierarchical Data Processing Configuration
  15. Hierarchical Data Processing with Schema Changes
  16. Intelligent Structure Models
  17. Blockchain
  18. Stateful Computing
  19. Appendix A: Connections Reference
  20. Appendix B: Data Type Reference
  21. Appendix C: Function Reference

Nested Aggregate Functions

Nested Aggregate Functions

A nested aggregate function in a window function performs a calculation separately for each partition. A nested aggregate function behaves differently in a window function and an Aggregator transformation.
A nested aggregate function in an Aggregator transformation performs a calculation globally across all rows. A nested aggregate function in an Expression transformation performs a separate calculation for each partition.
For example, you configure the following nested aggregate function in an Aggregator transformation and an Expression transformation:
MEDIAN ( COUNT ( P1 ) )
You define P2 as the group by port in the Aggregator transformation.
The function takes the median of the count of the following set of data:
P1
P2
10
1
7
1
12
1
11
2
13
2
8
2
10
2
RETURN VALUE: 3.5
When you include nested aggregate functions in an Expression transformation and configure the transformation for windowing, the function performs the calculation separately for each partition.
You partition the data by P2 and specify a frame of all rows preceding and all rows following. The window function performs the following calculations:
  1. COUNT (P1) produces one value for every row. COUNT returns the number of rows in the partition that have non-null values.
  2. MEDIAN of that value produces the median of a window of values generated by COUNT.
The window function produces the following outputs:
P1
P2
Output
10
1
3
7
1
3
12
1
3
11
2
4
13
2
4
8
2
4
10
2
4
You can nest aggregate functions with multiple window functions. For example:
LAG ( LEAD( MAX( FIRST ( p1 )))
You can nest any number of the window functions LEAD and LAG, but you cannot nest more than one aggregate function within another aggregate function.


Updated September 07, 2020