+ Reply to Thread
Results 1 to 7 of 7

Transpose Batch Excel Data

Hybrid View

ChaidaJones Transpose Batch Excel Data 08-10-2020, 07:23 PM
alansidman Re: Transpose Batch Excel Data 08-10-2020, 08:19 PM
ChaidaJones Re: Transpose Batch Excel Data 08-10-2020, 10:17 PM
ChaidaJones Re: Transpose Batch Excel Data 08-10-2020, 10:45 PM
maniacb Re: Transpose Batch Excel Data 08-10-2020, 10:52 PM
ChaidaJones Re: Transpose Batch Excel Data 08-11-2020, 04:32 AM
alansidman Re: Transpose Batch Excel Data 08-11-2020, 03:41 AM
  1. #1
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,705

    Re: Transpose Batch Excel Data

    With Power Query/Get and Transform which is on the Data Tab. Here is the Mcode resulting from that transformation

    let
        Source = Excel.CurrentWorkbook(){[Name="Table33"]}[Content],
        #"Demoted Headers" = Table.DemoteHeaders(Source),
        #"Changed Type" = Table.TransformColumnTypes(#"Demoted Headers",{{"Column1", type text}, {"Column2", type text}, {"Column3", type text}, {"Column4", type text}, {"Column5", type number}, {"Column6", type number}, {"Column7", type number}, {"Column8", type number}, {"Column9", type number}, {"Column10", type number}, {"Column11", type number}, {"Column12", type number}, {"Column13", type number}}),
        #"Transposed Table" = Table.Transpose(#"Changed Type"),
        #"Merged Columns" = Table.CombineColumns(Table.TransformColumnTypes(#"Transposed Table", {{"Column1", type text}, {"Column2", type text}}, "en-US"),{"Column1", "Column2"},Combiner.CombineTextByDelimiter(":", QuoteStyle.None),"Merged"),
        #"Transposed Table1" = Table.Transpose(#"Merged Columns"),
        #"Promoted Headers" = Table.PromoteHeaders(#"Transposed Table1", [PromoteAllScalars=true]),
        #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Promoted Headers", {"Origin City:", "Origin State:", "Destination City:", "Destination State:"}, "Attribute", "Value"),
        #"Split Column by Delimiter" = Table.SplitColumn(#"Unpivoted Other Columns", "Attribute", Splitter.SplitTextByDelimiter(":", QuoteStyle.Csv), {"Attribute.1", "Attribute.2"}),
        #"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Attribute.1", Int64.Type}, {"Attribute.2", Int64.Type}})
    in
        #"Changed Type1"
    Review PQ
    In the attached file
    Click on any cell in the new table
    On the Data Tab, click on Queries & Connections
    In the right window, double click to open Query
    Review PQ steps

    M-code basics:
    - "let" is the start of a query
    - "in" is the closing of a query
    - each transformation step sits in between those 2 lines
    - each step line is ended by a comma, except the last one
    - "Source" is always the first step (Source Data)
    - After "in" you have the last step referenced
    Attached Files Attached Files
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  2. #2
    Registered User
    Join Date
    01-05-2016
    Location
    Texas, USA
    MS-Off Ver
    Office 365
    Posts
    13

    Re: Transpose Batch Excel Data

    It absolutely worked. I added the additional data to the file that you sent and refreshed the Query and it populated all the data I needed. Thank you so much. You saved me a ton of time. I do have a question though, where can I see the Mcode in case I wanted to manipulate it by adding more columns to the Source file?

  3. #3
    Registered User
    Join Date
    01-05-2016
    Location
    Texas, USA
    MS-Off Ver
    Office 365
    Posts
    13

    Re: Transpose Batch Excel Data

    It absolutely worked. I added the additional data to the file that you sent and refreshed the Query and it populated all the data I needed. Thank you so much. You saved me a ton of time. I do have a question though, where can I see the Mcode in case I wanted to manipulate it by adding more columns to the Source file?

+ 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. Batch Transpose
    By probuddha in forum Excel General
    Replies: 3
    Last Post: 01-12-2017, 08:05 AM
  2. [SOLVED] Aggregate Batch Data from many word docs into an Excel (i.e.Check Boxes, Text Form Fields)
    By Chrisdudley7 in forum Word Formatting & General
    Replies: 7
    Last Post: 05-13-2014, 01:28 PM
  3. [SOLVED] Formula to round down on a batch and exclude anything under a full batch
    By toomuchbrew in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-15-2012, 11:04 AM
  4. Replies: 0
    Last Post: 06-19-2012, 11:36 AM
  5. [SOLVED] Batch extract PDF data to Excel using regular expressions
    By dwilkie@gmail.com in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-25-2006, 05:15 AM
  6. How to batch create / generate and print invoices from Excel data?
    By helenerz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-04-2005, 10:05 PM
  7. Excel charts data auto range / batch update ?
    By agb in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 05-22-2005, 10:44 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