Comment on page
Table.TransformColumnNames
Transforms column names by using the given function.
function (table
as table,nameGenerator
as function, optionaloptions
as nullable record) as table
Transforms column names by using the given
nameGenerator
function. Valid options: MaxLength
specifies the maximum length of new column names. If the given function results with a longer column name, the long name will be trimmed. Comparer
is used to control the comparison while generating new column names. Comparers can be used to provide case insensitive or culture and locale aware comparisons. The following built in comparers are available in the formula language: Table.Column operations
Remove the
#(tab)
character from column namesTable.TransformColumnNames(Table.FromRecords({[#"Col#(tab)umn" = 1]}), Text.Clean)
Table.FromRecords({[Column = 1]}, {"Column"})
Transform column names to generate case-insensitive names of length 6.
Table.TransformColumnNames(Table.FromRecords({[ColumnNum = 1, cOlumnnum = 2, coLumnNUM = 3]}), Text.Clean, [MaxLength = 6, Comparer = Comparer.OrdinalIgnoreCase])
Table.FromRecords({[Column = 1, cOlum1 = 2, coLum2 = 3]}, {"Column", "cOlum1", "coLum2"})
Last modified 5yr ago