ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
RÉSOLU

Reorganize Text Input into separate fields

Gilld
Astéroïde

I would like to reorganize the attached data (image) into two fields; City and Postcode - what would be the best way to do this? 

12 RÉPONSES 12
LordNeilLord
Aurore

Hi @Gilld,

 

I'd go for something like this logic, if there are no numbers in the field (and I'm not aware of any UK city with numbers in the name) then it's a city else its a postcode. Then applying this logic to a multirow formula you can get something like this:

 

Postcodes.PNGExample attached

 

@LordNeilLord

Part time Tableau, Part Time Alteryx. Full Time Awesome


Data Lover

LordNeilLord
Aurore

@Gilld

 

Did the solution work?

 

@LordNeilLord

Part time Tableau, Part Time Alteryx. Full Time Awesome


Data Lover

Gilld
Astéroïde

Thanks for this @LordNeilLord !! Sorry I can't seem to split the field into 'contains numbers' and 'doesn't contain numbers'?

Gilld
Astéroïde

Thanks for this!! Sorry I can't seem to split the field into 'contains numbers' and 'doesn't contain numbers'?

LordNeilLord
Aurore

If you use the RegEx_CountMatches([Field1], "\d") = 0 (like I showed in my example) ...which is basically saying, count the numbers in the field

 

@LordNeilLord

Part time Tableau, Part Time Alteryx. Full Time Awesome


Data Lover

Gilld
Astéroïde

Hi @LordNeilLord, I am getting the attached - not quite sure how this helps?

LordNeilLord
Aurore

Hey @Gilld

 

Your Multirow formula isn't quite right...try this:

 

If RegEx_CountMatches([City],"\d")=0 Then [City] Else [Row-1:NewField]
Endif

And you need to set your newfield to be a string type.

 

You can use the multirow formula i provided in the original attachement

 

@LordNeilLord

Part time Tableau, Part Time Alteryx. Full Time Awesome


Data Lover

Gilld
Astéroïde

Thanks @LordNeilLord!

 

The field has split (attached) - but the postcodes and cities are now muddled up? 

 

LordNeilLord
Aurore

@Gilld

That is super weird!

 

Can you send me the flat file you are using and I can have a proper look?

 

@LordNeilLord

Part time Tableau, Part Time Alteryx. Full Time Awesome


Data Lover

Étiquettes
Auteurs des meilleures solutions