Row to fixed column
Example
There is the scores.xlsx file of the student score sheet, some of the data is shown in the figure below:
Now it needs to be converted into the format shown in the figure below, which should be listed in the order of Chinese, Maths, and English.
Write SPL script:
A |
|
1 |
=T("E:/work/scores.xlsx") |
2 |
=A1.pivot(No,Name;Subject,Score;"Chinese","Maths","English") |
3 |
=T("E:/work/scores1.xlsx",A2) |
A1 Read in the scores.xlsx file
A2 Group by No and Name, row to column A1, Subject value as the new column name, Score value as the new column value, and the new column names are arranged in the order of "Chinese", "Maths", and "English".
A3 Save A2 to the file scores1.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/