5.10 Split by column - merge duplicate rows after splitting
There is a product data table ProductCategories.xls:
This table contains the category information of products, such as CategoryID, CategoryName, Description, etc. Now we need to separate the category information columns to form one Categories table, and take the remaining product columns as the Products table. Since there are many products under one category field, and many of them are duplicate after splitting, deduplication needs to be performed.
The results after splitting are shown as below:
Categories.xlsx:
Products.xlsx:
Script:
A | |
---|---|
1 | =T(“ProductCategories.xlsx”) |
2 | =A1.groups(CategoryID,CategoryName,Description) |
3 | =A1.new(CategoryID,ProductID,ProductName,QuantityPerUnit,UnitPrice,UnitsInStock,UnitsOnOrder,ReorderLevel) |
4 | =T(“Categories.xlsx”,A2) |
5 | =T(“Products.xlsx”,A3) |
https://c.scudata.com/article/1651916536524
https://c.scudata.com/article/1653780329498
https://c.scudata.com/article/1653878658632
SPL Official Website 👉 https://www.esproc.com
SPL Feedback and Help 👉 https://www.reddit.com/r/esProc_Desktop/
SPL Learning Material 👉 https://c.esproc.com
Discord 👉 https://discord.gg/2bkGwqTj
Youtube 👉 https://www.youtube.com/@esProcDesktop
Linkedin Group 👉 https://www.linkedin.com/groups/14419406/