๐ Top N Average Function
๐ Definition
This function is used to:
โก๏ธ Sum the values โโof a field
โก๏ธ Then take the N data with the largest average value
In other words:
Aggregate + Automatic Ranking (Top N based on AVERAGE)
โ๏ธ Parameter
1. ๐ฏ Field
Fields to be averaged
Example:
2. ๐ข Number of Record (N)
- The amount of data you want to display
- Example:
- 5 โ Top 5
- 10 โ Top 10
3. ๐ Ordered (Y/N)
- Y (Yes) โ results are sorted (descending by average)
- N (No) โ results are not guaranteed
๐ Recommendation: use Y for clear results (Largest top)
๐ฅ Input & ๐ค Output
Input
-
Previous result data (usually after GroupBy)
Output
The output will contain:
- All input fields
- New fields:
- Field grouping with postfix_new
- Avg result field
๐ง How it works
For example data:
category views
---------------------
Music 100
Music 200
Gaming 300
Gaming 100
After the process:
1. Average per category
category avg_views
--------------------------
Music 150
Gaming 200
2. Top N (for example N=1)
category_new avg_views
-------------------------
Gaming 200
๐งช Case Study Examples
๐ฏ Case:
Displays the Top 3 YouTube categories with the most average views
๐ Workflow
- Source โ data YouTube
- GroupBy โ category
- Top N Average:
- Field = views
- Number of Record = 3
- Ordered = Y
๐ Output:
category_new avg_views
-----------------------------
Music 1000
Gaming 900
News 850
๐ก Important Note:
The useful output fields from this buffer function are the grouped fields and new fields. Add a Transformator (

) assembly afterward to select these fields.