Quantcast
Channel: Desktop topics
Viewing all articles
Browse latest Browse all 213819

Invoking function causes "Expression.Error: We cannot convert a value of type Record to type Number"

$
0
0

 

 

Hi, I'm trying to create a function that will rename all columns in a table., but when I invoke the function (from both the query editor and navigation panel) I get the folliwng error:

 

An error occurred in the ‘fnRenameColumns’ query. Expression.Error: We cannot convert a value of type Record to type Number.
Details:
Value=Record
Type=Type

 

The function is:

 

 

let
    fnRenameColumns = (tableName as table) =>
let
    Source = tableName,
    ColumnNames = Table.FromList(Table.ColumnNames(Source)),
    Transform = Table.AddColumn(ColumnNames,"New Value",each Text.Upper(Text.Replace([Column1],"_"," "))),
    RenameColumns = Table.RenameColumns(tableName,Table.ToRows(Transform),[Comparer = Comparer.OrdinalIgnoreCase])
in
    RenameColumns
in 
    fnRenameColumns

 

 

Any ideas? Thanks!


Viewing all articles
Browse latest Browse all 213819

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>