Consulting

Results 1 to 8 of 8

Thread: Power Query to transpose a dataset

  1. #1

    Power Query to transpose a dataset

    Hello.

    Please reference the attached file with three sheets as current (sheet1), unpivoted (sheet2) and final (sheet3).

    This has to be done in PQ, because the unpivoted data set produces over 1 million records.

    Thanks!
    Attached Files Attached Files

  2. #2
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,871
    Take a look at the table at cell A5 of the Final sheet.
    Not yet generalised/flexible. No handling differerent numbers of columns in source data yet.
    Could do with a bit more sample data.
    Attached Files Attached Files
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  3. #3
    Well, thank you kind sir. Please see attached expanded dataset.
    Attached Files Attached Files

  4. #4
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,871
    See the attached at cell A1 of the Final sheet.
    Only 5 rows big at the moment to save space, so needs refreshing to see the full list.
    Attached Files Attached Files
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  5. #5
    I tested it on the full dataset, and it looks to be performing flawlessly. Thank you!

  6. #6
    Hi p45cal.

    Would you be able and willing to offer a variation of your code to extract an unpivoted list of distinct Key | Value(s)?

    Thanks!

  7. #7
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,871
    See the sheet Table2 in the attached.
    Attached Files Attached Files
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  8. #8
    Quote Originally Posted by p45cal View Post
    See the sheet Table2 in the attached.
    Thank you, Sir.

Posting Permissions

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