Appending tables using M...

Matty

Well-known Member
Joined
Feb 17, 2007
Messages
3,717
Hi,

I've created a new table (table2) by transforming data from an existing table (table1). I would now like to append some other data to table2 from table1.

I can do this quite easily by creating a new table and combining the two tables, but I'd like to do it all within one script to avoid the creation of a further table.

Can this be done? If so, what is the correct syntax?

I've tried:
Code:
#"Combine Tables" = Table.Combine({table2, Table.SelectColumns(table1,{"1Column", "2Column", "3Column"})})

But it throws up a cyclic reference error.

Cheers,

Matty
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Never mind - figured it out! :)

I'm slowly getting my head around M - promise!

Cheers,

Matty
 
Upvote 0
Matty

It would be interesting to see what solution you arrive at, could you post it?
 
Upvote 0
Hi Norie,

I should have referenced the previous step in my code.

Corrected version below:

Code:
#"Combine Tables" = Table.Combine({[COLOR=#ff0000]#"Filtered Rows"[/COLOR], Table.SelectColumns(table1,{"1Column", "2Column", "3Column"})})

Cheers,

Matty
 
Upvote 0

Forum statistics

Threads
1,223,898
Messages
6,175,272
Members
452,628
Latest member
dd2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top