+ Reply to Thread
Results 1 to 16 of 16

Can PQ have dynamic table names

  1. #1
    Registered User
    Join Date
    07-31-2020
    Location
    South Africa
    MS-Off Ver
    Office 365
    Posts
    8

    Question Can PQ have dynamic table names

    Good day

    Im looking for assistance with regards to a automated step in Power Queries, specifically the "append" function. I have many sheets created from a template sheet and each sheet will have a different name. Inside each sheet there is the exact same table, but unique data. I must create a summary table of all these sheets, but also each time i create a new sheet using a copy of the template and renaming it to, lets say PT####. This means i have many PT number sheets(ie project sheets) and i would like to summarize our projects into one.

    I tried using Macro record, while creating the table connection(query) and then append it to the "Summary" sheet, but im limited to the table name and sheet name that changes each time.

    Looking forward to some assistance please

    Edit: I have a post as well on another forum...hoping that someone can assist me sooner, but a needy hand must be patient. Apologies.Cant post the link as i need to get more experience with this forum
    Last edited by Kabous07; 07-31-2020 at 12:46 AM.

  2. #2
    Forum Contributor
    Join Date
    03-18-2014
    Location
    Singapore
    MS-Off Ver
    Excel 2016 / 2019
    Posts
    251

    Re: Can PQ have dynamic table names

    Hi,

    it will be good that you upload a mockup of your worksheets so that folks in this forum will have a clearer pictures of what sort of "Dynamic" solution that you would want to achieve, dynamic parameter is one of the way, or you are table about each table name that always changed by users, however when you bring into PQ, they will automatically name in as Table1, Table2, Table3 and so on.

    Rgds
    Christopher Yap

  3. #3
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: Can PQ have dynamic table names

    Hi Kabous,

    It sounds like you want to import all the files in a single folder option in PQ. I'm only finding examples of .csv files but Excel files are also supported.
    https://exceloffthegrid.com/power-qu...s-in-a-folder/
    better example on:
    https://support.microsoft.com/en-us/...en%20workbooks.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  4. #4
    Registered User
    Join Date
    07-31-2020
    Location
    South Africa
    MS-Off Ver
    Office 365
    Posts
    8

    Re: Can PQ have dynamic table names

    Hi Marvin

    All of the tables and sheets would be in one workbook. It would be to difficult to explain to all my colleagues how change file paths if they have different folders. So we are trying to keep all the information on one workbook.

  5. #5
    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. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,396

    Re: Can PQ have dynamic table names

    Which other forum did you post on? You can post the link with gaps in it. Please do so.
    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.

  6. #6
    Registered User
    Join Date
    07-31-2020
    Location
    South Africa
    MS-Off Ver
    Office 365
    Posts
    8

    Re: Can PQ have dynamic table names

    Quote Originally Posted by AliGW View Post
    Which other forum did you post on? You can post the link with gaps in it. Please do so.
    I cant seem to post links, it give me a error saying i must first reply/post more to insert a link. The other Forum is MrExcel

  7. #7
    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. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,396

    Re: Can PQ have dynamic table names

    Thank you.

    If all the tables are in one workbook, you can use the ExcelWorkbook.Current() command in a blank query to append them.

  8. #8
    Registered User
    Join Date
    07-31-2020
    Location
    South Africa
    MS-Off Ver
    Office 365
    Posts
    8

    Re: Can PQ have dynamic table names

    Do you think it would be possible to automate?

    Its easy to create a connection manually and append manually. But to automate the query connections and append will variate on the table name and sheet name that gets added in the workbook. All of the information will be on one workbook.

    I could probably do tsomething different like record a marco button where i copy and insert the data in the summary table(in summary sheet), but then the data wont update when edited in the project sheets.

  9. #9
    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. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,396

    Re: Can PQ have dynamic table names

    There are instructions at the top of the page explaining how to attach your sample workbook.

  10. #10
    Registered User
    Join Date
    07-31-2020
    Location
    South Africa
    MS-Off Ver
    Office 365
    Posts
    8

    Re: Can PQ have dynamic table names

    Quote Originally Posted by AliGW View Post
    There are instructions at the top of the page explaining how to attach your sample workbook.
    Thank you for replying. I think im frustrating the system here, because i have already posted in another forum. Would you rather recommend that i remove one of the threads. This way i dont waste anyone time.

  11. #11
    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,937

    Re: Can PQ have dynamic table names

    I would not recommend you delete any, but rather as Ali has suggested, type out the link manually so that all can see any progress and not duplicate the efforts. Additionally, upload a sample of your data after reading the yellow banner at the top of this page telling you how to do that. We are here to help, but you must assist us with these requests.
    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

  12. #12
    Registered User
    Join Date
    07-31-2020
    Location
    South Africa
    MS-Off Ver
    Office 365
    Posts
    8

    Re: Can PQ have dynamic table names

    Quote Originally Posted by alansidman View Post
    I would not recommend you delete any, but rather as Ali has suggested, type out the link manually so that all can see any progress and not duplicate the efforts. Additionally, upload a sample of your data after reading the yellow banner at the top of this page telling you how to do that. We are here to help, but you must assist us with these requests.
    Sure thing and well noted thank you.

    I would like to add a link but i get a error : "You are not allowed to post any kinds of links, images or videos until you post a few times."

    I have finished the excel sample accordingly and think i might have uploaded it correctly, hopefully.

    I have removed the first part of the link, the post is in MrExcel. /board/threads/vba-power-query-connection.1141588/
    Attached Files Attached Files
    Last edited by Kabous07; 07-31-2020 at 08:01 AM.

  13. #13
    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,937

    Re: Can PQ have dynamic table names

    I think that the tutorial below should do exactly what you need.

    https://trumpexcel.com/combine-data-...ple-workbooks/

    Once in place, any new files added to the folder will automatically append when you click on the refresh Icon.

  14. #14
    Registered User
    Join Date
    07-31-2020
    Location
    South Africa
    MS-Off Ver
    Office 365
    Posts
    8

    Re: Can PQ have dynamic table names

    Quote Originally Posted by alansidman View Post
    I think that the tutorial below should do exactly what you need.



    Once in place, any new files added to the folder will automatically append when you click on the refresh Icon.

    Thank you Alan and AliGW. I will study this and will make it work.

  15. #15
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: Can PQ have dynamic table names

    Hi Kabous,

    See if this YouTube video does what you are asking for:
    https://www.youtube.com/watch?v=FI4HkCzMaIk

  16. #16
    Registered User
    Join Date
    07-31-2020
    Location
    South Africa
    MS-Off Ver
    Office 365
    Posts
    8

    Re: Can PQ have dynamic table names

    [QUOTE=MarvinP;5373502]Hi Kabous,

    See if this YouTube video does what you are asking for:
    w.youtube.com/watch?v=FI4HkCzMaIk

    Thank you, what perfect timing of her! Was glad to come across the video on youtube and also seen you posting it. Just what I was looking for.

+ 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] Map Columns With Different Header Names Using A Dynamic Table
    By jlanderson18 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-05-2016, 09:04 AM
  2. Replies: 10
    Last Post: 10-09-2014, 06:20 PM
  3. Dynamic range names based on pivot table fields?
    By Gandalf21 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-23-2013, 07:47 PM
  4. Dynamic range names based on pivot table fields?
    By Gandalf21 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-23-2013, 11:47 AM
  5. [SOLVED] Creating new Pivot table with dynamic sheet names/ranges
    By KeriM in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-08-2013, 08:54 AM
  6. Make Table Names in Formulas Dynamic
    By bbailey19087 in forum Excel General
    Replies: 1
    Last Post: 09-21-2011, 05:57 PM
  7. Dynamic Field Names in Excel 97 Pivot Table?
    By JanieA in forum Excel General
    Replies: 0
    Last Post: 07-08-2009, 04:14 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