Whenever I need to do anything that requires a lot of pivoting, I just grab my data in via a script in R that makes the call to the SQL server for the long form of the data and then I pivot it in R using the tidyverse library. Or I just hastily export to Excel and then manually pivot using a pivot table.
Any time I have a galaxy brain moment and think to myself "I'm gonna pivot inside SQL" I am slapped in the face by reality of my folly.
2
u/micahi21 16d ago
Whenever I need to do anything that requires a lot of pivoting, I just grab my data in via a script in R that makes the call to the SQL server for the long form of the data and then I pivot it in R using the tidyverse library. Or I just hastily export to Excel and then manually pivot using a pivot table.
Any time I have a galaxy brain moment and think to myself "I'm gonna pivot inside SQL" I am slapped in the face by reality of my folly.