13.12 Interconversion of rows and columns within a group
Here below is a data table:
Now we want to convert the data to the following form:
Script:
A | |
---|---|
1 | =‘Sheet1!A1:C8’ |
2 | =A1.group@u(~(1)) |
3 | =A2.(transpose(.(.to(2,)))) |
4 | =A3.(~.(A2.(~(1)(1))(A3.#)|~)).conj() |
A2: Group by the first column (Countries)
A3: Transpose the data in each group (except the country column)
A4: Concatenate the country and merge
The processing method described above is used for column-to-row conversion, this method works for row-to-column conversion as well.
esProc Desktop and Excel Processing
13.11 Rearrange multiple columns into a cross-tab
13.13 Interconversion of rows and columns in reverse order
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/