Simple Deduplicating
Example1
From a sequence of numbers, select the number that is not duplicated.
Write SPL script:
A |
|
1 |
[1,2,2,3,5,7,8,3,6,1,9,10,15,9] |
2 |
=A1.id() |
A1 The number sequence
A2 Take out the distinct members in A1
The result in A2 after running is: [1,2,3,5,6,7,8,9,10,15]
Example2
The Excel file book1.xlsx has two columns of Car and Color. Part of the data is shown in the figure below:
The task is to list the distinct colors in each car category, as shown in the figure below:
Write SPL script:
A |
|
1 |
=T("E:/car/book1.xlsx") |
2 |
=A1.group@1(Car,Color) |
3 |
=T("E:/car/book2.xlsx",A2) |
A1 Read the data of book1.xlsx
A2 Group the data by Car and Color, and the @1 option means to take only the first record of each group after grouping
A3 Store the result in A2 to book2.xlsx
SPL Official Website 👉 https://www.scudata.com
SPL Feedback and Help 👉 https://www.reddit.com/r/esProc_Desktop/
SPL Learning Material 👉 https://c.scudata.com
Discord 👉 https://discord.gg/cFTcUNs7
Youtube 👉 https://www.youtube.com/@esProcDesktop
Linkedin Group 👉 https://www.linkedin.com/groups/14419406/