BookmarkSubscribeRSS Feed
Choose Language Hide Translation Bar

Community Trekker


Nov 30, 2011

Grouping Selected Columns and Transposing Script

I routinely have to group variables and transpose them to get data into a format that can be analysed. The initial report comes from a database and is the format as in attachment 'Input'.

What I wish to do is the following

  • have a list of all the column names produced and for me to be able to select different 'groups'. These groups can have different names and so the group name needs to be definable ( this example I have just used 'solvent' and 'surfactant' but there can be many of them) so a 'pop-up' during this selection would be ideal.
  • 8829_Solection 1.JPG8830_Solection 2.JPG
  • these groups should then be transposed and the name of the file produced the same as the group name attachments 'solvent' & 'Surfactant'.
  • Ideally, but not essentially, these should then be joined onto the original table with the columns removed that have been transposed - see 'Desired Output'.

this simple data manipulation can take me a while to do before anything is ready for the data to be analysed, this is one of my routine and repetitive 'jobs' that I have to do and I feel it could definitively be automated. I also can believe that this script wouldn't be useful for many other people as part of the routine nature of any analysis.

Many regards