Append Existing Tables Variable Number of Times using Text.Combine

SStrange

Board Regular
Joined
Oct 21, 2013
Messages
52
So my question is... is there a way to repeat the Table.Combine append a variable number of times?

My initial though was to use Text.Repeat nested in Text.ToList to create the range with the number of times being variable using a criteria created by a number count.

let
TC01 = TagCount,
AppIpt = AppendInput,
Source = Excel.CurrentWorkbook(){[Name="Table2"]}[Content],
#"Added Index" = Table.AddIndexColumn(#"Changed Type", "Index", 1, 1),
#"Appended Query" = Table.Combine(Text.ToList(Text.Middle(Text.Repeat(AppIpt, TC01),0,Text.Length(Text.Repeat(AppIpt, TC01))-2))),

in
#"Appended Query"
<strike></strike>
<strike></strike>

TagCount is a variable RowCount.
AppIpt is the text equivalent if I just manually append.

If I put it into a column to see that it is ordered as a list correctly, it exports the text correctly. I am sure there is something I am missing.

I am trying to emulate a select query from a SQL query such as follows:

SELECT TBL1.OBJ1,
TBL2.OBJ1,
TBL1.OBJ2,
TBL2.OBJ1
FROM TBL1, TBL2

I apologize in advance about the formatting... Not sure how to make that work here.

Thank you in advance for any help.


 
Last edited:

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

Forum statistics

Threads
1,223,888
Messages
6,175,212
Members
452,618
Latest member
Tam84

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