+ Reply to Thread
Results 1 to 3 of 3

Moving Row-Level Output data into Columns

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

    Moving Row-Level Output data 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

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Moving Row-Level Output data into Columns

    Are these the only two tables you need converted?
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

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

    Re: Moving Row-Level Output data into Columns

    Yes, these are the only two tables (fortunately).

  4. #4
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Moving Row-Level Output data into Columns

    I tried posting this last night, but the site was down.

    Here is something built for the two tables, but is expandable.

    It makes use of excel tables, pivot tables and dynamic named ranges.

    I have two pivot tables for each data set. One is simply a unique list of names (Pivot 1), the other is the data that results when you use this name in the filter (Pivot 2).

    There are named ranges that overlay the Pivot 1s: EDU_Ids and WH_IDs. This is one way of doing it.

    The code loops through the IDs, sets the pivot table filters, and copies and pastes the data into the results page. The data is appended to the end of the current working row.

    A new row is started for each new ID.

    You can copy / paste your actual data into the tables I set up and everything should work.

    The macro to run is MakeDataMaster.
    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. [SOLVED] Moving Average Data Output Problem - Analysis Toolpak
    By zanshin777 in forum Excel General
    Replies: 1
    Last Post: 10-08-2015, 01:22 AM
  3. [SOLVED] Moving Average Data Output Difference - Analysis Toolpak
    By zanshin777 in forum Excel General
    Replies: 1
    Last Post: 10-04-2015, 04:51 PM
  4. How to create a basic level userform with input as date and cell values as output
    By catchnanan in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-15-2013, 02:52 PM
  5. Replies: 1
    Last Post: 04-09-2012, 09:21 AM
  6. Replies: 2
    Last Post: 12-15-2011, 11:49 PM
  7. Replies: 2
    Last Post: 11-14-2011, 06:22 PM

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