Hi, I'm Ask INFA!
What would you like to know?
ASK INFAPreview
Please to access Ask INFA.

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

Nested aggregate functions as window functions

Nested aggregate functions as window functions

A nested aggregate function in a window function performs a separate calculation for each partition.
When you include nested aggregate functions in an Expression transformation and configure the transformation for window functions, the function performs the calculation separately for each partition.
You partition the data by P2 and specify a frame of All Preceding Rows and All Following Rows. The window functions perform 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 functions produce 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 multiple window functions LEAD and LAG, but you cannot nest more than one aggregate function within another aggregate function.

0 COMMENTS

We’d like to hear from you!