Add Column with Table Name

RobertN

New Member
Joined
Jan 10, 2020
Messages
4
Office Version
365, 2016
Platform
Windows
I am very new to Excel Power Query. I have created a simple query that aggregates data from all excel files in a specific folder. These files are specific to individual employees but there is no column with the employee's name. I can't tell which record belongs to which employee and I really don't want to add a "Name" column to the source tables. Is there an easy way to add a column that appends the source table name to each record (row)?
 

RobertN

New Member
Joined
Jan 10, 2020
Messages
4
Office Version
365, 2016
Platform
Windows
The employee names are reflected in the file names (i.e., john.xlsx) and the name of the tables where the source data resides, but not in any cells in the table.
 

sandy666

Well-known Member
Joined
Oct 24, 2015
Messages
3,786
sure,
so if you did From Folder hit Edit not Combine
then you'll see columns Content and Name and some more
select Content and Name then Remove Other Columns
Extract employee name via Transform tab (after delimiter/before delimiter or whatever)
Expand Content
Expand column Data (choose columns you want to use)

hope that help
 

RobertN

New Member
Joined
Jan 10, 2020
Messages
4
Office Version
365, 2016
Platform
Windows
Thank you, Sandy. I am able to load the file name and additional file specific information like extension, date accessed, folder path, etc. However, that just produces a list of the files that exist in the folder, not the data in the workbook table. I need the employee name appended to each record (row) that was derived from their file/table. The file that John maintains is called John.xlsx, in this workbook there is a worksheet (tab named DATA) with a table named "John" with headings like Date, Time, Client, Units Sold, etc. (but no column with employees name). There are several other files that follow the same convention in the source folder. I have been able to successfully pull the individual employee data (referencing the DATA worksheets) and load into a table in excel, but I also need a column that adds the employee name to each row that was derived from their table (or file).
 

sandy666

Well-known Member
Joined
Oct 24, 2015
Messages
3,786
here is : example video
Book1, Book2, Book3 are your employee names
I lost a few steps before :)
 

RobertN

New Member
Joined
Jan 10, 2020
Messages
4
Office Version
365, 2016
Platform
Windows
Thank you so much, Sandy! That is exactly what I was looking for.
 

sandy666

Well-known Member
Joined
Oct 24, 2015
Messages
3,786
You are welcome
apologies for the inconvenience
have a nice day
 

Forum statistics

Threads
1,081,962
Messages
5,362,420
Members
400,675
Latest member
tombailey

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top