Forum Discussion
Super Weird Time Column
- 4 years ago
Hi Thigs
First off, it looks like you are missing the square brackets on some of your references to the Time column, which is likely the cause of the error.
Secondly, you can simplify the code by using Text.PadStart.
The code in the Custom Column dialog box would look like:
Custom Time = Text.PadStart( [Time], 6, "0" )I'm assuming Time is a text column by the way.
Regards,
Owen
They disappear because PQ wants to treat them automatically as numbers. Just remove the automatic type recognition piece from the code in the right pane (where the steps are defined) and set your own types for all the columns. For this column the type should be 'text', obviously. There's no need to type any fancy formulas to 'regain' the zeros.
You mean the first step where it says source? I already tried that, it isn't working. I changed the original step to make it text, not numeric, it still isn't happy.
- daXtreme4 years ago
Solution Sage
First, make sure the column from the source is imported into PQ as text, not a number. I don't know what you import this from but if this is, say, SQL Server, just make sure this column in the table/view is really text (varchar/nvarchar).