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: 832
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:
Guest(s) 9
Currently Browsing this Page:
1 Guest(s)
1 Guest(s)
Top Posters:
Catalin Bombea: 1939
SunnyKow: 1432
Anders Sehlstedt: 919
Purfleet: 415
Frans Visser: 349
Hans Hallebeek: 339
David_Ng: 306
lea cohen: 248
Jessica Stewart: 219
A.Maurizio: 216
Newest Members:
Craige Thompson
Elmo Erasmus
Robbin Kappelhof
Drew Smith
Michael Denton
Nick Pascal
David Webb
Johannes Bruentrup
John Jay
Larry Silverman
Forum Stats:
Groups: 3
Forums: 25
Topics: 7073
Posts: 30998
Member Stats:
Guest Posters: 49
Members: 34471
Moderators: 2
Admins: 3
Administrators: Mynda Treacy, Philip Treacy, Jessica
Moderators: Velouria, Riny van Eekelen
© Simple:Press —