Forum

Pad with leading 0
 
Notifications
Clear all

Pad with leading 0

3 Posts
2 Users
0 Reactions
258 Views
(@evdheever)
Posts: 6
Active Member
Topic starter
 

Hi Everyone

In my data set, I have an ArticleCode in Data Type:  Text.

In order to reference with other tables, I need to pad with leading 0 to an 18-digit number.

I've tried the following formula, but still end up with an error:

=Text.PadStart( [Article Code], 18, 0)

How do I correct this error?

Thank you!

Eduard

 
Posted : 30/06/2017 5:39 am
(@mynda)
Posts: 4762
Member Admin
 

Hi Eduard,

Text.PadStart is looking for a text value for the pad. Try putting your zero in double quotes like this:

=Text.PadStart( [Article Code], 18, "0")

 

Mynda

 
Posted : 30/06/2017 6:56 am
(@evdheever)
Posts: 6
Active Member
Topic starter
 

HI Mynda

As simple as that! Laugh

Thank you very much!

Eduard 

 
Posted : 30/06/2017 11:26 am
Share: