Combine Selected tables in Current Workbook

Hi

I need a PQ solution for the following - I have tried several approaches but none of them work.

All I need to do is combine tables in the Current Workbookstarting where the table name starts with “t_City”.

I need it to be in the most memory-efficient manner possible :grinning:

Thank You

Allister
Combine.xlsx (14.7 KB)

Hi @AllisterB,

Give this a go.

let
    Source = Excel.CurrentWorkbook(),
    FilterRows = Table.SelectRows(Source, each Text.StartsWith([Name], "t_City"))[[Content]],
    ExpandContent = Table.ExpandTableColumn(FilterRows, "Content", {"Name", "Age", "Value"}, {"Name", "Age", "Value"})
in
    ExpandContent 

image

Here’s your sample. Combine.xlsx (108.2 KB)
I hope this is helpful

Hi

Thank You so much

How do I include the Source Table Name in a column?

Allister

Hi @AllisterB,

In future try to avoid this type of re-iteration of your question and supply a mockup of the desired results - thank you!

In the FilterRows step I only kept the [Content] column, remove that selection and you’ll get the table name as well.

Updated file. Combine.xlsx (116.3 KB)
I hope this is helpful

1 Like