Top N Max


๐Ÿ“Š Top N Max Function

๐Ÿ” Definition

This function is used to:

โžก๏ธ Count the values โ€‹โ€‹of a field
โžก๏ธ Then take the N data with the largest max value

In other words:
    Aggregate + Automatic Ranking (Top N based on MAX)

โš™๏ธ Parameter

1. ๐ŸŽฏ Field

Fields to be calculated the Max value

Example:

2. ๐Ÿ”ข Number of Record (N)

3. ๐Ÿ”€ Ordered (Y/N)

๐Ÿ“Œ Recommendation: use Y for clear results (Largest top)

๐Ÿ“ฅ Input & ๐Ÿ“ค Output

Input Output
The output will contain:

๐Ÿง  How it works

For example data:
    category        views
    ---------------------
    Music           100
    Music           200
    Gaming          300
    Gaming          100
    Gaming          50
After the process:
1. Max value per category
    category        max_views
    --------------------------
    Music           200
    Gaming          300
2. Top N (for example N=1)
    category_new    max_views
    -------------------------
    Gaming          300

๐Ÿงช Case Study Examples

๐ŸŽฏ Case:

Displays the Top 3 YouTube categories with the most max views

๐Ÿ”„ Workflow ๐Ÿ“Š Output:
    category_new	max_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.