Window functions
Use window functions to compute averages, sort, rank, or count items, calculate sums, and find minimum or maximum values.
Window functions overview
Window function query syntax
Example query layout
OVER clause
Partition by clause
Order by clause
Frame clause
Supported Pinot window functions
Function
Description
Example
Default Value When No Record Selected
Examples of windows functions
Sum transactions by customer ID
customer_id
payment_date
amount
sum
Find the minimum or maximum transaction by customer ID
customer_id
payment_date
amount
min
0.99
0.99
0.99
4.99
4.99
2.99
2.99
2.99
Find the average transaction amount by customer ID
customer_id
payment_date
amount
avg
5.66
5.66
5.66
7.99
7.99
3.99
3.99
3.99
Rank year-to-date sales for a sales team
Row
FirstName
LastName
Total sales YTD
2251368.34
2151341.64
1551363.54
1251358.72
Count the number of transactions by customer ID
customer_id
payment_date
amount
count
Was this helpful?

