Skip to main content

Table.Combine

Tiek atgriezta tabula, kas ir iegūta, apvienojot sarakstā ietvertās tabulas.

Syntax

Table.Combine(
tables as list,
optional columns as any
) as table

Remarks

Tiek atgriezta tabula, kas tiek iegūta, sapludinot tabulu sarakstu, tables. Iegūtās tabulas rindu struktūru nosaka columns, bet, ja “columns” vērtība nav norādīta, rindu struktūru nosaka ievades tipu apvienojums.

Examples

Example #1

Sapludiniet visas trīs tabulas.

Table.Combine({
Table.FromRecords({[CustomerID = 1, Name = "Bob", Phone = "123-4567"]}),
Table.FromRecords({[CustomerID = 2, Name = "Jim", Phone = "987-6543"]}),
Table.FromRecords({[CustomerID = 3, Name = "Paul", Phone = "543-7890"]})
})

Result:

Table.FromRecords({
[CustomerID = 1, Name = "Bob", Phone = "123-4567"],
[CustomerID = 2, Name = "Jim", Phone = "987-6543"],
[CustomerID = 3, Name = "Paul", Phone = "543-7890"]
})

Example #2

Varat sapludināt trīs tabulas ar dažādu struktūru.

Table.Combine({
Table.FromRecords({[Name = "Bob", Phone = "123-4567"]}),
Table.FromRecords({[Fax = "987-6543", Phone = "838-7171"]}),
Table.FromRecords({[Cell = "543-7890"]})
})

Result:

Table.FromRecords({
[Name = "Bob", Phone = "123-4567", Fax = null, Cell = null],
[Name = null, Phone = "838-7171", Fax = "987-6543", Cell = null],
[Name = null, Phone = null, Fax = null, Cell = "543-7890"]
})

Example #3

Varat sapludināt divas tabulas un projicēt uz doto tipu.

Table.Combine(
{
Table.FromRecords({[Name = "Bob", Phone = "123-4567"]}),
Table.FromRecords({[Fax = "987-6543", Phone = "838-7171"]}),
Table.FromRecords({[Cell = "543-7890"]})
},
{"CustomerID", "Name"}
)

Result:

Table.FromRecords({
[CustomerID = null, Name = "Bob"],
[CustomerID = null, Name = null],
[CustomerID = null, Name = null]
})

Category

Table.Row operations