简体   繁体   中英

Expression.Error: We cannot convert the value null to type Text. Details: Value= Type=Type

I want to combine multiple files with different headings and i found this video which was perfect. I get up to minute 12 and it fails and i get this error "Expression.Error: We cannot convert the value null to type Text. Details: Value= Type=Type"

my code for the power query is = Table.TransformColumnNames(stuff_Table, each List.Accumulate(Table.ToRecords(Headings), _ , (state, current)=>Text.Replace(Text.Upper(state), current [BEFORE],current[AFTER]) ))

I want to combine three files. One with a template that will be used for tableau but is otherwise blank, and the other two files with the data but in inconsistent formatting. How do i fix this?

It sounds like you are trying to apply a transformation that takes TEXT as input on data of type NULL. This means that PowerQuery is expecting a textual input but receives nothing. You need to make sure it receives a textual input (by adapting your source & replacing null with a text value), or that your PowerQuery formula handles null values explicitly (typically by some variation of "if field = null then "empty" else field").

Text.Replace(Text.Upper(state) ==> Most likely, the state field is NULL in at least one instance (one line) of your source. Maybe the Tableau template file?

Try replacing empty fields by "null" or "empty" or "no state" or even a white space " "). This can be done either manually within the source (transform the column or create a new column) or within PowerQuery.

A quick google search on "Power query replace Null with text" gives a range of options.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM