Baca dalam bahasa Inggris

Bagikan melalui


Table.ReplaceKeys

Sintaksis

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

Tentang

Menggantikan kunci tabel yang ditentukan.

Contoh 1

Ganti kunci tabel yang ada.

Penggunaan

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

Output

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