+ Reply to Thread
Results 1 to 8 of 8

Rolling Row-Level Output data up into Columns

  1. #1
    Registered User
    Join Date
    02-03-2017
    Location
    Pittsburgh, USA
    MS-Off Ver
    Office 16
    Posts
    7

    Rolling Row-Level Output data up into Columns

    I have a scenario where I need to move additional data in rows with the same primary key into additional columns. I've pulled data from our internal database via SQL Server Mgmt. Studio, and need to roll up certain data points respective to each primary key (candidate ID).

    For instance: each candidate ID may have multiple work history or education history data sets--I need to roll up each change in the data into new, separate columns (See attached for current format & desired format).

    Each candidate ID (roughly 100,000 unique IDs) may have more than 2 sets of education history and work history--it could be any number, so the VBA script will need to account for those possibilities (i.e. run until candidate ID changes).
    I'm hoping this is possible--the case for this is for a data migration between our legacy system & a new system that needs the data rolled up into additional columns.
    Attached Files Attached Files
    Last edited by burghman787; 02-07-2017 at 03:22 PM.

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,906

    Re: Rolling Row-Level Output data up into Columns

    Hi there,
    I know a person can ask whatever he/she wants and has his/her special reason for wanting it in a particular manner.

    I am just wondering why you want to transpose a quite normal table to something which is unmanageable and very difficult to oversee.
    If a candidate has had 10 jobs and each job has 5 fields of data you are looking at 50 columns excluding the Candidate ID and name.

    I am sure that what you want can be done, maybe somebody will pick it up but I am really curious to know why this particular and in my honest opinion unmanageable lay-out?
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Registered User
    Join Date
    02-03-2017
    Location
    Pittsburgh, USA
    MS-Off Ver
    Office 16
    Posts
    7

    Re: Rolling Row-Level Output data up into Columns

    Hi Keebellah,

    I can't disagree with you. Unfortunately, the import file for our new system requires that each candidate have one row of data, and it will read the column header to determine what field the data will be migrated into in the new database. It's messy, and I would prefer not to, but in order to bring over the data this is the way they require it.

    I could certainly limit it to 3 jobs if it would make this actually feasible.

    I'm trying to avoid doing manual concatenating/manipulation within Excel, so I was hoping I could find a VBA module to use to do this.

  4. #4
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,906

    Re: Rolling Row-Level Output data up into Columns

    Any number of jobs is feasable but I was just curious as to the reason.
    I'll see what I can do for you.
    Probably something like SAP or other ...... database

  5. #5
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,906

    Re: Rolling Row-Level Output data up into Columns

    I think this will do it.

    Place the code in the worksheet's VBA

    Please Login or Register  to view this content.

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    02-03-2017
    Location
    Pittsburgh, USA
    MS-Off Ver
    Office 16
    Posts
    7

    Re: Rolling Row-Level Output data up into Columns

    Thank you for your help with this!
    Unless I'm doing something incorrectly, when running within VBA it puts all of the data in the worksheet into just the 2nd row, not onto each row respective of the candidate ID.

    I've attached a sample workbook with 100 rows of data for each of work history & education history. Could you try and let me know if you're getting the same results?
    Attached Files Attached Files

  7. #7
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,906

    Re: Rolling Row-Level Output data up into Columns

    Okay, I'll look, yes, I did NOT take into account the diffrent ID's, my mistake. I assumed just one cadidate at a time.
    This (I think) will be easily solved.

    Will download the file and get to it.
    Sorry again.

  8. #8
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,906

    Re: Rolling Row-Level Output data up into Columns

    Okay, got it (it think)

    The same for both worksheets again.
    Just let it run an keep the status bar in sight it shows the progress, even it excel says "Not responding"
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Moving Row-Level Output data into Columns
    By burghman787 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-03-2017, 12:52 PM
  2. calculation of variation of data of rolling columns
    By Dan3456 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-29-2016, 03:25 PM
  3. Rolling Average Output to an Array
    By bsamuels in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-21-2015, 05:11 PM
  4. Replies: 1
    Last Post: 04-09-2012, 09:21 AM
  5. Replies: 2
    Last Post: 12-15-2011, 11:49 PM
  6. Replies: 2
    Last Post: 11-14-2011, 06:22 PM
  7. Rolling over data in columns
    By payrollgal in forum Excel General
    Replies: 0
    Last Post: 10-09-2008, 10:30 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1