2

I have a csv file to import to Power Query (250,000 records). One field contains our fee codes which are usually entered as numbers but sometimes contain characters (e.g. 17, 17A, 67, 67A, etc). When I import the file to Power Query, the field is treated as a numeric column and all the data with letters is not imported. I can convert the field to text AFTER the import - but by then it is too late and I have lost all the non numeric data. How can I tell Power Query to bring in this field as TEXT not as a number?

Is there an easy way to change the way the data is imported without having to change the data file or manually create a schema file? P.S. I am new to Power Query so this may be something simple that I have overlooked - but I really have looked!

4

1 回答 1

1

Power Query 在某些数据源(如 CSV)之后添加了自动类型转换步骤。如果您查看已应用的步骤列表,您会看到最后一步是更改类型的步骤。您可以删除该步骤以撤消类型更改。

您还可以通过使公式栏可见(可以通过转到“查看”功能区并选中“公式栏”复选框来启用)然后编辑列类型来编辑该步骤。例如,如果您的公式是:

= Table.TransformColumnTypes(#"Promoted Headers",{{"Date", type datetime}, {"ID", Int64.Type}})

您可以通过将 Int64.Type 更改为 将 ID 更改为文本类型type text

于 2015-05-05T05:22:18.773 回答