Skip to main content

Table.ReplaceKeys

แทนที่คีย์ของตารางที่ระบุ

Syntax​

Table.ReplaceKeys(
table as table,
keys as list
) as table

Remarks​

แทนที่คีย์ของตารางที่ระบุ

Examples​

Example #1​

แทนที่คีย์ที่มีอยู่ของตาราง

let
table = Table.FromRecords({
[Id = 1, Name = "Hello There"],
[Id = 2, Name = "Good Bye"]
}),
tableWithKeys = Table.AddKey(table, {"Id"}, true),
resultTable = Table.ReplaceKeys(tableWithKeys, {[Columns = {"Id"}, Primary = false]})
in
resultTable

Result:

Table.FromRecords({
[Id = 1, Name = "Hello There"],
[Id = 2, Name = "Good Bye"]
})

Category​

Table.Transformation