PDA

View Full Version : Transform data type in column



Swede_21
12-12-2019, 09:17 AM
Hello,

I am retrieving data through Power Query from an Oracle DB live to an Excel workbook. In PQ, under the "Transform" tab, there is a function to change the data type of a column, that I use to get all the decimal numbers displayed. In the M-code the function is called TransformColumnTypes. However I have some strings in the data that I cannot change to decimal number and produce an error. Is there a way to exclude these? Because the function takes the whole column at the moment.

Pictures provided before / after applying function for clarification.256242562525626

Thanks!

Jan Karel Pieterse
12-13-2019, 03:36 AM
If you want to set the column as numbers it -by definition- cannot contain anything that isn't a number, so there is no way to both set a column to numbers AND have that column retain anything that isn't a number. But perhaps this post helps you to find a solution: https://blog.gbrueckl.at/2013/12/error-handling-in-power-query/