+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    06-23-2009
    Location
    Los Angeles
    MS-Off Ver
    Excel 2007
    Posts
    25

    Reverse Pivot - Matrix to record

    I have a worksheet of attributes in the columns (equity tickers) and rows (dates) with element values in the cells (returns).
    I want to turn this matrix into records for loading into Access: Equity, Date, Return along with some other constants.
    Does anyone know an easy way to do this in Excel or Access. I am comfortable using VBA. I am running Office 2010 Beta.
    Thank you.

  2. #2
    Cheeky Forum Moderator Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2003, 2007, 2010
    Posts
    3,605

    Re: Reverse Pivot - Matrix to record

    Can you post some sample data indicating the structure you're starting with along with the ending structure you want?
    Regards,

    Ron
    Microsoft MVP - Excel
    (Oct 2006 - Sep 2012)

    Click here to see the Forum Rules

  3. #3
    Registered User
    Join Date
    06-23-2009
    Location
    Los Angeles
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Reverse Pivot - Matrix to record

    Sure. Not sure if I am supposed to use code tags?

    From Excel:
    A B C
    1 Date SEP AHD
    2 11/9/2007 -0.0278 0.0530%
    3 11/16/2007 0.0005 -0.0101%

    To Access:
    Equity Date Return
    SEP 11/9/2007 -0.0278
    SEP 11/16/2007 0.0005
    AHD 11/9/2007 0.0530
    AHD 11/16/2007 -0.0101

    It is effectively the reverse of a Pivot, which summarizes record-based data into a matrix view.

  4. #4
    Forum Moderator DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Suffolk, UK
    MS-Off Ver
    2002, 2007 & 2010
    Posts
    21,379

    Re: Reverse Pivot - Matrix to record

    You can use a Multi Consolidation PT to generate the required output.

    Begin the PT Wizard (in 2007 easiest to do this via keyboard shortcut if not on your QAT - press ALT + D -> P)

    Step1
    -- opt for a Multi Consolidation PT

    Step 2
    -- opt to Crete Page Fields yourself

    Step 3
    -- add your existing table (so appears in All Ranges)

    Click FINISH

    On the resulting PT double click on the Grand Total number (bottom right hand corner cell)

    You should now find you have the same data transposed (date, code, value) - this sheet is independent of all others so you can manipulate it however you wish without fear of affecting the source data.

    EDIT:
    If you want a "live" demo see: http://datapigtechnologies.com/flash...osetables.html
    Last edited by DonkeyOte; 12-02-2009 at 12:42 PM. Reason: added link

  5. #5
    Registered User
    Join Date
    06-23-2009
    Location
    Los Angeles
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Reverse Pivot - Matrix to record

    Thank you, that worked.
    Excel 2010 makes it harder to find how to flatten the row labels - it stacks them by default.

Thread Information

Users Browsing this Thread

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

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.2.0