Jason Wier
Member
Members
Forum Posts: 23
Member Since:
September 14, 2021
September 14, 2021
Offline
Good evening.
I have a zip code nightmare file.
Some zip codes contain the plus four added (1st example), some fail to include a leading zero (2nd example), and some contain just the 5 digits (last example). I need to have them with just the 5 digits. Looking forward to see how the great minds resolve this one 😉
What it is… | What it needs to be… |
236013428 | 23601 |
80811912 | 08081 |
37924 | 37924 |
Velouria
London or thereabouts
Moderator
Members
Trusted Members
Moderators
Trusted Members
Moderators
Forum Posts: 842
Member Since:
November 1, 2018
November 1, 2018
Offline
Make sure the Zip field loads as text, then you can use something like:
= Table.AddColumn(#"Changed Type", "CleanZip", each if Text.Length([Addressee Zip]) <=5 then Text.PadStart([Addressee Zip], 5, "0") else Text.PadStart(Text.Start([Addressee Zip], Text.Length([Addressee Zip])-4), 5, "0"))
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Lionel Baijot
Guest(s) 7
Currently Browsing this Page:
1 Guest(s)
1 Guest(s)
Top Posters:
Catalin Bombea: 1944
SunnyKow: 1432
Anders Sehlstedt: 956
Purfleet: 415
Hans Hallebeek: 377
Frans Visser: 351
David_Ng: 318
lea cohen: 248
Jessica Stewart: 219
A.Maurizio: 216
Newest Members:
Techia Braveboy
Charles Buchanan
Tiago Braga
Rehan Baig
Fred HORVATH
Silke Schmidt
Stuart Barr
Amelia Nolte
David Wier
T P Collins
Forum Stats:
Groups: 3
Forums: 25
Topics: 7154
Posts: 31382
Member Stats:
Guest Posters: 50
Members: 34655
Moderators: 2
Admins: 3
Administrators: Mynda Treacy, Philip Treacy, Jessica
Moderators: Velouria, Riny van Eekelen
© Simple:Press —