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.
SOLUCIONADO

Reorganize Text Input into separate fields

Gilld
Asteroide

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 RESPOSTAS 12
LordNeilLord
Aurora

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
Aurora

@Gilld

 

Did the solution work?

 

@LordNeilLord

Part time Tableau, Part Time Alteryx. Full Time Awesome


Data Lover

Gilld
Asteroide

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

Gilld
Asteroide

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

LordNeilLord
Aurora

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
Asteroide

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

LordNeilLord
Aurora

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
Asteroide

Thanks @LordNeilLord!

 

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

 

LordNeilLord
Aurora

@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

Rótulos
Autores com maior número de soluções