+ Reply to Thread
Results 1 to 12 of 12

Transforming table to desire format using Query Editor (merge cell, transpose etc)

  1. #1
    Forum Contributor
    Join Date
    03-12-2012
    Location
    Singapore
    MS-Off Ver
    MS 365
    Posts
    532

    Transforming table to desire format using Query Editor (merge cell, transpose etc)

    Hi, please refer to sample, anyone can teach me how to transform the table to my format? This format is what my company currently using.
    Attached Files Attached Files

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,879

    Re: Transforming table to desire format using Query Editor (merge cell, transpose etc)

    I used Power Query and used Get and Transform to transpose the Data. Added a new column A and copied dates and transposed to column A. Then a simple insert columns for profit and simple math to get answer.
    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

  3. #3
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Cool Re: Transforming table to desire format using Query Editor (merge cell, transpose etc)

    another way
    (without path to external file)
    Please Login or Register  to view this content.


    J
    K
    L
    M
    N
    O
    P
    10
    Des Sales Cost Profit Sales_1 Cost_1 Profit_1
    11
    Brand A A B B
    12
    Jan'18
    1217
    1394
    177
    2525
    1349
    -1176
    13
    Feb'18
    1212
    1042
    -170
    2693
    1692
    -1001
    14
    Mar'18
    1367
    1151
    -216
    3988
    2374
    -1614
    15
    Apr'18
    1260
    1288
    28
    1453
    1088
    -365
    16
    May'18
    1256
    1189
    -67
    4353
    3706
    -647
    17
    Jun'18
    1478
    1086
    -392
    1412
    2300
    888
    18
    Jul'18
    1335
    1261
    -74
    4503
    2539
    -1964
    19
    Aug'18
    1059
    1005
    -54
    1043
    4919
    3876
    20
    Sep'18
    1310
    1385
    75
    1256
    4799
    3543
    21
    Oct'18
    1097
    1365
    268
    4259
    1448
    -2811
    22
    Nov'18
    1096
    1220
    124
    2879
    4375
    1496
    23
    Dec'18
    1048
    1095
    47
    1271
    3838
    2567

    imho, result is not correct because:
    1. table shouldn't contain double header rows: eg. Sales / A
    2. headers cannot be duplicated (that is why there is sale and sale_1)
    3. inconsitent data: one column contain mixed type of data like text and numbers (see point 1)

    and it would look like:


    J
    K
    L
    M
    N
    O
    P
    10
    Date Sales A Cost A Profit A Sales B Cost B Profit B
    11
    01/01/2018
    1217
    1394
    177
    2525
    1349
    -1176
    12
    01/02/2018
    1212
    1042
    -170
    2693
    1692
    -1001
    13
    01/03/2018
    1367
    1151
    -216
    3988
    2374
    -1614
    14
    01/04/2018
    1260
    1288
    28
    1453
    1088
    -365
    15
    01/05/2018
    1256
    1189
    -67
    4353
    3706
    -647
    16
    01/06/2018
    1478
    1086
    -392
    1412
    2300
    888
    17
    01/07/2018
    1335
    1261
    -74
    4503
    2539
    -1964
    18
    01/08/2018
    1059
    1005
    -54
    1043
    4919
    3876
    19
    01/09/2018
    1310
    1385
    75
    1256
    4799
    3543
    20
    01/10/2018
    1097
    1365
    268
    4259
    1448
    -2811
    21
    01/11/2018
    1096
    1220
    124
    2879
    4375
    1496
    22
    01/12/2018
    1048
    1095
    47
    1271
    3838
    2567
    Last edited by sandy666; 06-07-2018 at 01:56 AM.

  4. #4
    Forum Contributor
    Join Date
    03-12-2012
    Location
    Singapore
    MS-Off Ver
    MS 365
    Posts
    532

    Re: Transforming table to desire format using Query Editor (merge cell, transpose etc)

    Where in the query editor is the "demote header" option?

  5. #5
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Transforming table to desire format using Query Editor (merge cell, transpose etc)

    Transform - Use First... (choose your option)

  6. #6
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Transforming table to desire format using Query Editor (merge cell, transpose etc)

    If that takes care of your original question, & to say Thanks and for better Motivation, please
    1. click on Add Reputtion (bottom left corner of the post of the person(s) who helped you)
      then
    2. select Thread Tools from the menu (top right corner of your thread) and mark this thread as SOLVED.
    If you did it already - ignore it.
    Thank you.

  7. #7
    Forum Contributor
    Join Date
    03-12-2012
    Location
    Singapore
    MS-Off Ver
    MS 365
    Posts
    532

    Re: Transforming table to desire format using Query Editor (merge cell, transpose etc)

    Query editor is so hard. Harder than vba. Think i need go google n learn Query Editor from scratch.....

  8. #8
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Transforming table to desire format using Query Editor (merge cell, transpose etc)


  9. #9
    Forum Contributor
    Join Date
    03-12-2012
    Location
    Singapore
    MS-Off Ver
    MS 365
    Posts
    532

    Re: Transforming table to desire format using Query Editor (merge cell, transpose etc)

    Ya, like that image u paste just now, its not even in vba format.
    Find it hard to understand.
    N the layout of the Query Editor itself is also very complicated. So many button and the word they use is very technical, like Excel spreadsheet where the button's wording is very straightforward.

  10. #10
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Transforming table to desire format using Query Editor (merge cell, transpose etc)

    You need to learn everything, VBA, Excel, PowerQuery. Nothing is easy but IMHO PQ is much easier than VBA I don't like VBA because everything there you must create manually.
    What will you do if IT doesn't allow you to use VBA for some reason?
    In Excel 2016 / 365 PQ is built-in

    but no problem, don't like it? don't use it
    Get it or forget it...
    Last edited by sandy666; 06-07-2018 at 04:14 AM.

  11. #11
    Forum Contributor
    Join Date
    03-12-2012
    Location
    Singapore
    MS-Off Ver
    MS 365
    Posts
    532

    Re: Transforming table to desire format using Query Editor (merge cell, transpose etc)

    Well said! Will try to learn from Scratch =)

  12. #12
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Transforming table to desire format using Query Editor (merge cell, transpose etc)

    You should

    You got a link with PQ Help so read it, test it, test it................................ test it
    then
    test it

+ 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] Query Editor transforming Cross Tab data but Row header (date) become Text.
    By jp16 in forum Excel Charting & Pivots
    Replies: 8
    Last Post: 06-06-2018, 06:37 AM
  2. [SOLVED] Transforming data without Power Query
    By jomili in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-22-2017, 11:16 AM
  3. [SOLVED] Transpose horizontal table to a vertical table via query
    By Journeyman3000 in forum Access Tables & Databases
    Replies: 5
    Last Post: 12-03-2015, 10:21 PM
  4. [SOLVED] Transforming Table and appending to one cell... conditionally.
    By falkon007 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-09-2013, 08:32 PM
  5. [SOLVED] How to copy data range form one sheet to other sheet with desire Reverse Transpose ?
    By nur2544 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-18-2013, 12:30 PM
  6. How to format cell to query in pivot table without using the droplist
    By jewellove in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 02-01-2013, 11:08 PM
  7. Mail Merge Query - Format of Merge Fields in Word
    By carlosbourn in forum Excel General
    Replies: 2
    Last Post: 11-10-2007, 07:11 AM

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