+ Reply to Thread
Results 1 to 9 of 9

Database creation and cleanup for large dataset

  1. #1
    Registered User
    Join Date
    07-08-2019
    Location
    England
    MS-Off Ver
    2016
    Posts
    4

    Database creation and cleanup for large dataset

    Hi everyone,

    I am working on a research project for which I need to create a database for 2000+companies. I got the list of the companies online whose current format looks similar to the one "currentlist" picture attached herecurrentlist.PNG. For my project, I need to list the companies in the manner shown on "expectedlist" picture. I am looking at 10 years of monthly data for these companies, and will be looking at their revenues and all. I do not know how can I structure my data in a way that for each company I have 1984 Month 1, 1984 Month 2 and so on. I would highly highly appreciate any help from you all.
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Database creation and cleanup for large dataset

    Your requirement isn't clear.

    Do you already have data for these companies, which you are trying to restructure? (In which case your attached workbook doesn't show the source data structure).

    Or are you trying to create a complete data entry template, crossjoining all months with all customers on the list?
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,853

    Re: Database creation and cleanup for large dataset

    Also, you've posted in the Access section - is this not an Excel question?
    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.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  4. #4
    Registered User
    Join Date
    07-08-2019
    Location
    England
    MS-Off Ver
    2016
    Posts
    4

    Re: Database creation and cleanup for large dataset

    Hi Olly,
    I can get the data for these companies without once I get the dates in place. I will be using Bloomberg tab in Excel to extract the data. I need help to automatically create the second column in my second picture for each company. I do not know how to even start that without manually doing all the entries.

  5. #5
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Database creation and cleanup for large dataset

    So you have a list of companies, and you want to create a blank table with one row per company per month, for a given range of years?

    That's easy, with PowerQuery. Format your company list as a table, then use something like:
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    07-08-2019
    Location
    England
    MS-Off Ver
    2016
    Posts
    4

    Re: Database creation and cleanup for large dataset

    Hi Olly,

    Thnk you so much for your help. Yes, you have the right idea for what I want to do with my data. Your code gave me the result in the picture, but I need to arrange my data per year per month for a company.
    Example:
    Company 1 1984M1
    1984M2
    ...
    1984M12
    Company 2 1984M1
    1984M2
    ...
    1984M12
    Company 3 1984M1
    1984M2
    ...
    1984M12
    I tried using Power Query, and wrote down the code you have posted.
    And for some reason I got null in the columns where I was supposed to have company names. Thank you once again!! Attachment 631284

  7. #7
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Database creation and cleanup for large dataset

    Check you've either named your Company table correctly (tblCompanies), or change that value in the Companies step of the code, to match your actual table name.

    See worked example in attached workbook - change the query to "Load To" a table, to materialise the output.
    Attached Files Attached Files
    Last edited by Olly; 07-08-2019 at 11:15 AM.

  8. #8
    Registered User
    Join Date
    07-08-2019
    Location
    England
    MS-Off Ver
    2016
    Posts
    4

    Re: Database creation and cleanup for large dataset

    Hi Olly,
    Yes, it is finally working well with my actual data. Thank you very very much!

  9. #9
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Database creation and cleanup for large dataset

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. You may also "Add Reputation" to those who helped you. Thanks.

+ 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. WOrk with large dataset
    By Judith_Chao in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-14-2019, 05:35 AM
  2. Best way of indexing large dataset
    By chisox721 in forum Excel General
    Replies: 3
    Last Post: 03-27-2019, 08:45 AM
  3. Replies: 3
    Last Post: 10-20-2017, 12:40 AM
  4. Replies: 3
    Last Post: 01-23-2014, 10:13 AM
  5. Replies: 3
    Last Post: 08-16-2013, 01:13 AM
  6. [SOLVED] Graphing a large dataset
    By CTM2012 in forum Excel General
    Replies: 6
    Last Post: 06-18-2012, 03:48 PM
  7. Graphing a large dataset
    By CTM2012 in forum Excel General
    Replies: 9
    Last Post: 06-18-2012, 10:20 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