+ Reply to Thread
Results 1 to 18 of 18

Pivot friendly data

  1. #1
    Forum Contributor
    Join Date
    11-12-2014
    Location
    Reading
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2403 Build 16.0.17425.20176) 64-bit
    Posts
    142

    Pivot friendly data

    Hi,

    I need to analyse revenue/profit data period by period last year vs this year but the format I extract it from the database in is not pivot-friendly.

    Is there a way to automate the data transformation so I can paste new data into a document and refresh pivots so I can do the analysis I need?

    I need to view each owner and compare a period this year vs last year. I also need to view the numbers as a whole so the total for the team in a period this year vs last year.

    Thanks.
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    04-07-2019
    Location
    Turkey-Ankara-Çubuk
    MS-Off Ver
    Office 2010
    Posts
    71

    Re: Pivot friendly data

    Hi, Power Query code..
    Please Login or Register  to view this content.
    Attached Files Attached Files

  3. #3
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,936

    Re: Pivot friendly data

    Is there always 13 periods in a full year?
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  4. #4
    Forum Contributor
    Join Date
    11-12-2014
    Location
    Reading
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2403 Build 16.0.17425.20176) 64-bit
    Posts
    142

    Re: Pivot friendly data

    Quote Originally Posted by CK76 View Post
    Is there always 13 periods in a full year?
    Yes, always 13 x 4 week periods every year.

  5. #5
    Forum Contributor
    Join Date
    11-12-2014
    Location
    Reading
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2403 Build 16.0.17425.20176) 64-bit
    Posts
    142

    Re: Pivot friendly data

    Quote Originally Posted by veyselemre View Post
    Hi, Power Query code..
    Please Login or Register  to view this content.
    Thanks, but I wouldn't have clue what to do with this.

  6. #6
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,936

    Re: Pivot friendly data

    Use the file uploaded by @veyselemre. Go to "filename" sheet and edit the formula to...
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Then refresh data. It will give you result in pivot table friendly format.

    If you need to study what steps are taken. Go to Data ribbon tool -> Queries and Connections. Double click on "tableData".

    You can follow transformation steps applied in Query pane (to the right of screen).

    Edit: Click on each steps and you can see intermediate result of each steps.

  7. #7
    Forum Contributor
    Join Date
    11-12-2014
    Location
    Reading
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2403 Build 16.0.17425.20176) 64-bit
    Posts
    142

    Re: Pivot friendly data

    I did as instructed but upon refresh, I get an error message...

    "Query 'tableData' 9step 'myData') references other queries or steps, so it may not directly access a data source. Please rebuild this data combination".

    I've opened Queries and Connections and double-clicked on 'tableData' and I can see the same error/warning message with a button to edit settings on the first 2 steps. I can see the list of steps on the right-hand side, although all in Turkish.

    Attachment 868507

    I've clicked the edit settings button and pasted the file path and am now being presented with the below issue from step 9 onwards.

    'Expression.Error: We cannot apply operator & to types Text and Table.
    Details:
    Operator=&
    Left=-
    Right=[Table]'

    I'm stuck at this point and unsure if copying and pasting the file path was the right thing to do.

    Attachment 868508

  8. #8
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,936

    Re: Pivot friendly data

    Here's steps.

    1. Make sure to save the file in local drive.
    2. Initially formula will give error. Make sure that you change "dosyaadi" with "filename" and evaluate. Check that it returns valid path.
    3. Refresh Data. Table.

    There should be no errors generated.

    If that doesn't work... Let me see if I can create full tutorial on steps.

  9. #9
    Forum Contributor
    Join Date
    11-12-2014
    Location
    Reading
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2403 Build 16.0.17425.20176) 64-bit
    Posts
    142

    Re: Pivot friendly data

    Quote Originally Posted by CK76 View Post
    Here's steps.

    1. Make sure to save the file in local drive.
    2. Initially formula will give error. Make sure that you change "dosyaadi" with "filename" and evaluate. Check that it returns valid path.
    3. Refresh Data. Table.

    There should be no errors generated.

    If that doesn't work... Let me see if I can create full tutorial on steps.
    Saved on Desktop, evaluated, and returns valid path.

    Refresh gives the same error.

  10. #10
    Forum Contributor
    Join Date
    11-12-2014
    Location
    Reading
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2403 Build 16.0.17425.20176) 64-bit
    Posts
    142

    Re: Pivot friendly data

    Converted the images to jpg and tried again in the hope these work.

    Attachment 868550

    &

    Attachment 868551

  11. #11
    Forum Contributor
    Join Date
    11-12-2014
    Location
    Reading
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2403 Build 16.0.17425.20176) 64-bit
    Posts
    142

    Re: Pivot friendly data

    Copy of workbook. The only thing I have done is change the filename.
    Attached Files Attached Files

  12. #12
    Forum Contributor
    Join Date
    11-12-2014
    Location
    Reading
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2403 Build 16.0.17425.20176) 64-bit
    Posts
    142

    Re: Pivot friendly data

    I've managed to figure it out. There is a privacy issue. Not sure how to get around it without building it myself. If you have a tutorial, I'd really appreciate it.

    Thanks.

  13. #13
    Registered User
    Join Date
    04-07-2019
    Location
    Turkey-Ankara-Çubuk
    MS-Off Ver
    Office 2010
    Posts
    71

    Re: Pivot friendly data

    It is best to manually write the address of your file in cell A2 on the filename page. Can you try right-clicking on the green table in the data page and refreshing?

  14. #14
    Forum Contributor
    Join Date
    11-12-2014
    Location
    Reading
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2403 Build 16.0.17425.20176) 64-bit
    Posts
    142

    Re: Pivot friendly data

    Quote Originally Posted by veyselemre View Post
    It is best to manually write the address of your file in cell A2 on the filename page. Can you try right-clicking on the green table in the data page and refreshing?
    That worked. Amazing, thank you.

  15. #15
    Forum Contributor
    Join Date
    11-12-2014
    Location
    Reading
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2403 Build 16.0.17425.20176) 64-bit
    Posts
    142

    Re: Pivot friendly data

    Quote Originally Posted by veyselemre View Post
    It is best to manually write the address of your file in cell A2 on the filename page. Can you try right-clicking on the green table in the data page and refreshing?
    A quick question... can I rename the tabs without affecting the workbook?

  16. #16
    Registered User
    Join Date
    04-07-2019
    Location
    Turkey-Ankara-Çubuk
    MS-Off Ver
    Office 2010
    Posts
    71

    Re: Pivot friendly data

    Quote Originally Posted by blackburnsexcel View Post
    A quick question... can I rename the tabs without affecting the workbook?
    Please Login or Register  to view this content.
    "Sheet 1" in the Power Query code shows the sheet name. You can edit here.

  17. #17
    Forum Contributor
    Join Date
    11-12-2014
    Location
    Reading
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2403 Build 16.0.17425.20176) 64-bit
    Posts
    142

    Re: Pivot friendly data

    I decided to use it as a separate workbook I can reference from my Dashboard in another workbook so no need now.

    This helped to create a fantastic dynamic dashboard that presents company data beautifully. And now it's easy to update with new data. I couldn't have done it without you, I really appreciate you taking your time out.

    Thank you.

  18. #18
    Registered User
    Join Date
    04-07-2019
    Location
    Turkey-Ankara-Çubuk
    MS-Off Ver
    Office 2010
    Posts
    71

    Re: Pivot friendly data

    I'm glad I could help. It was a nice brain exercise for me while learning PQ.

+ 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] Columnar Table to Pivot Friendly Table using VBA (with column data repetition)
    By DizerX in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-01-2019, 04:25 AM
  2. [SOLVED] How to transform my data into Pivot Table friendly data?
    By jp16 in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 11-22-2017, 05:41 PM
  3. Pivot Table Hyperlink with Friendly name VBA
    By JoKerr in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-26-2017, 12:29 PM
  4. [SOLVED] Input to pivto friendly data
    By Thonkhan in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 01-27-2014, 12:04 PM
  5. VBA help converting data to a pivot table friendly format.
    By JT314 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-21-2012, 01:52 PM
  6. [SOLVED] Re-arrange a worksheet range to a pivot-friendly table?
    By Alabaster in forum Excel General
    Replies: 4
    Last Post: 12-01-2011, 09:19 AM
  7. Advice on User-Friendly Pivot Table Question
    By pdxguy_2188 in forum Excel General
    Replies: 0
    Last Post: 03-03-2011, 07:14 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