Forum Discussion
Mic1979
1 year agoPost Partisan
Change Column name based on a replacement Chart
Hello I am using the following custom function to replace the vlue in my table: (data, replacements) => [ // generates a record with replacements repl = Function.Invoke(Record.FromList, List...
- 1 year ago
Hi Mic1979
If you're wanting a similar function to rename columns, you could use this:
(data, replacements) => // replacements is a two column table // Column 1: old name // Column 2: new name [ replacementsList = Table.ToRows(replacements), result = Table.RenameColumns(data,replacementsList,MissingField.Ignore) ][result]Is this what you were looking for?
OwenAuger
1 year agoSuper User
Hi Mic1979
If you're wanting a similar function to rename columns, you could use this:
(data, replacements) =>
// replacements is a two column table
// Column 1: old name
// Column 2: new name
[
replacementsList = Table.ToRows(replacements),
result = Table.RenameColumns(data,replacementsList,MissingField.Ignore)
][result]
Is this what you were looking for?
- Mic19791 year agoPost Partisan
It works. Many thanks