Bottom N Sum


πŸ“Š Bottom N Sum Function

πŸ” Definition

The Bottom N Sum function is used for:

➑️ Summing (SUM) the values ​​of a field
➑️ Retrieving N data with the SMALLEST total value


πŸ‘‰ The opposite of Top N Sum

βš™οΈ Parameter

1. 🎯 Field

Fields to be summed

Example:

2. πŸ”’ Number of Record (N)

The amount of data to be displayed (Bottom N)

Example:

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

πŸ“Œ Recommended: use Y for clear results

πŸ“₯ Input & πŸ“€ Output

Input Output
The output will contain:

🧠 How it works

Sample Data:
    category	views
    ------------------
    A           100
    A           200
    B           300
    B           100
    C           50

Step 1: SUM per category

    category	sum_views
    ----------------------
    A           300
    B           400
    C           50

Step 2: Bottom N (for example N=2)

    category_new    sum_views
    -------------------------
    C               50
    A               300   
    

πŸ§ͺ Case Study

🎯 Case:

Showing 3 categories with the LOWEST total views

πŸ”„ Workflow
  1. Source data
  2. GroupBy β†’category
  3. Bottom N Sum:
    • Field =views
    • Number of Record =3
    • Ordered =Y
πŸ“Š Output:
    category_new    sum_views
    --------------------------
    Education       10,000
    Travel          15,000
    Music           20,000

πŸ’‘ 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.