Forum

Add column that sho...
 
Notifications
Clear all

Add column that shows 'source table name'?

3 Posts
2 Users
0 Reactions
66 Views
(@ajjava)
Posts: 11
Eminent Member
Topic starter
 

I'm not sure if this is possible but figured I'd ask...

I have three tables that I need to combine in PQ

They all reside in the same workbook

When I've made an append query with the three tables, I'd love the 'table name' to appear next to each record, to show which table the record came from

 

So far, I've been adding a custom column that shows the table name, but that's extra steps

I would think, since I see the table names all throughout the M code, that there would be a way programmatically add the table name.

Any ideas?

 
Posted : 20/02/2019 8:08 am
(@mynda)
Posts: 4761
Member Admin
 

Hi Andrea,

In session 3.01 I show you how to do this.

Create a blank query. In the formula bar type =Excel.CurrentWorkbook() and press ENTER.

Click the double arrow on the Content column to expand the data in all of the tables and you'll see the Table name is retained.

Note: this assumes the data in each table is the same format.

Mynda

 
Posted : 20/02/2019 10:52 pm
(@ajjava)
Posts: 11
Eminent Member
Topic starter
 

Ahhh, thank you! I searched and queried on other Excel forums and the overall consensus was that this was not possible. I knew that answer just had to be unlikely, at best.

 
Posted : 21/02/2019 7:34 am
Share: