#119 — Group by the Expression

#119 — Group by the Expression

Problem description & analysis:

Here below is a data table:

Task: We want to group and aggregate by the first two digits of ID, and calculate the total sales of each group.

Solution:

Use SPL XLL and enter the following code:

=spl("=E(?1).groups(left(ID,2):ID;sum(Sales):Sales)",A1:C25)

The results are as follows:


Download esProc Desktop for FREE and enjoy the simplicity and efficiency of data analytics using SPL!! 🚀✨⬇️

✨SPL download address: esProc Desktop FREE Download

✨Plugin Installation Method: SPL XLL Installation and Configuration

✨References to other rich Excel operation cases: Desktop and Excel Data Processing Cases

✨YouTube FREE courses: SPL Programming