본문으로 건너뛰기

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