+ Reply to Thread
Results 1 to 12 of 12

Power Query Table Manipulation

Hybrid View

Steveapa Power Query Table Manipulation 01-15-2020, 09:56 PM
AliGW Re: Power Query Table... 01-16-2020, 01:46 AM
Steveapa Re: Power Query Table... 01-16-2020, 08:47 AM
AliGW Re: Power Query Table... 01-16-2020, 09:02 AM
Steveapa Re: Power Query Table... 01-16-2020, 09:31 PM
Ron Coderre Re: Power Query Table... 01-17-2020, 01:56 PM
Steveapa Re: Power Query Table... 01-28-2020, 03:17 PM
Ron Coderre Re: Power Query Table... 01-28-2020, 11:03 PM
AliGW Re: Power Query Table... 01-29-2020, 02:15 AM
Steveapa Re: Power Query Table... 01-29-2020, 08:49 AM
Steveapa Re: Power Query Table... 01-29-2020, 04:20 PM
Steveapa Re: Power Query Table... 01-29-2020, 04:39 PM
  1. #1
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Harrisburg, PA
    MS-Off Ver
    Office 365 MSO (16.0.10730.20264) 32-bit
    Posts
    170

    Power Query Table Manipulation

    Hi All.

    I have a query to an odbc to get my sales forecast by Year 1, Year 2, Year 3... and Start year. I want to convert the table to something more usable. Example below. Top is how I get the data, bottom is what I want I have done it in vba, but how to do it in Power query?

    Capture.JPG

    Thanks
    Steve

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,466

    Re: Power Query Table Manipulation

    Please attach the workbook.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Harrisburg, PA
    MS-Off Ver
    Office 365 MSO (16.0.10730.20264) 32-bit
    Posts
    170

    Re: Power Query Table Manipulation

    Hi AliGW.

    Thanks for the help, but I don't see an attached workbook??

    Thanks.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,466

    Re: Power Query Table Manipulation

    I asked you to provide the workbook. See instructions in the yellow box at the top.

  5. #5
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Harrisburg, PA
    MS-Off Ver
    Office 365 MSO (16.0.10730.20264) 32-bit
    Posts
    170

    Re: Power Query Table Manipulation

    Sorry, I mis-read. I have attached a sample file. The real data comes from an odbc to a server. I have pulled in some of the data to a Tab "Source Data for Power Query" and changed that to the query source. I am looking to use power query to convert the data to the format of tab "Results I want Format"

    Thanks for the help.
    Steve
    Attached Files Attached Files

  6. #6
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Power Query Table Manipulation

    See if you can work with the attached file. I didn't have a lot of time to work on this so the queries are a little ragged.
    Basically, I created a function that transforms one row from the source data into the structure you asked for.
    Then I created a comprehensive query that processes each record from the source data, using the function, and performs the final transformations.

    Is that something you can work with?
    Attached Files Attached Files
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  7. #7
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Harrisburg, PA
    MS-Off Ver
    Office 365 MSO (16.0.10730.20264) 32-bit
    Posts
    170

    Re: Power Query Table Manipulation

    Sorry... but I am getting an compatibality error. YOu must have a newer version of excel than I do. Error is in your fnTransformRecord. An error occurred in the " query.expression.error: The name 'Splitter.SplitTextBGyCharacterTransition' wasn't recognized.

    I have Microsoft Excel for Office 365 MSO (16.0.10730.20264) 32-bit

  8. #8
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Power Query Table Manipulation

    Not sure where you're finding "Splitter.SplitTextBGyCharacterTransition" in my code.
    The function in my file contains "Splitter.SplitTextByCharacterTransition"

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,466

    Re: Power Query Table Manipulation

    @Steve - please update your forum profile to show your current version of Excel. Thanks.

  10. #10
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Harrisburg, PA
    MS-Off Ver
    Office 365 MSO (16.0.10730.20264) 32-bit
    Posts
    170

    Re: Power Query Table Manipulation

    Profile updated

  11. #11
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Harrisburg, PA
    MS-Off Ver
    Office 365 MSO (16.0.10730.20264) 32-bit
    Posts
    170

    Cool Re: Power Query Table Manipulation

    I got it!!!! Here is what I did. I unpivoted all forecast Yr1, forecast Yr2, etc column. Then used the column name to pull out the 1 from Yr1, the 2 from Yr2... I then added this number to the Start year in a new column. Deleted the unpivoted column. Then I pivoted the new column which now has the actual year number.!!!!

    How do I mark this as solved???

    Thanks for your help anyway! Hope my solution helps someone else
    Steve
    Last edited by Steveapa; 01-29-2020 at 04:22 PM.

  12. #12
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Harrisburg, PA
    MS-Off Ver
    Office 365 MSO (16.0.10730.20264) 32-bit
    Posts
    170

    Re: Power Query Table Manipulation

    Here is the example file posted with the solution.

    Thanks again
    Steve
    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. [SOLVED] Power Query - load to workbook and create query table
    By jaryszek in forum Excel General
    Replies: 1
    Last Post: 12-10-2019, 11:09 AM
  2. [SOLVED] Power Pivot/Query Convert Existing Table to Query
    By trisoldee in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 08-23-2019, 04:27 PM
  3. POWER Query and Power Pivot Table !!
    By haitham.shop in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 08-06-2018, 04:09 PM
  4. Power Query and Power Pivot Table
    By haitham.shop in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 08-06-2018, 06:17 AM
  5. Power Query and Power Pivot Table !!
    By haitham.shop in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-06-2018, 06:15 AM
  6. POWER Query and Power Pivot Table !!
    By haitham.shop in forum Access Tables & Databases
    Replies: 0
    Last Post: 08-06-2018, 05:59 AM
  7. Sub-Forum for Excel Power Tools (Power Query, Power Pivot & Power BI)
    By chullan88 in forum Suggestions for Improvement
    Replies: 10
    Last Post: 06-28-2018, 02:25 PM

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