Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

how to extract the word from middle of the string in alteryx

RamyaGunasekaran
7 - Meteor

Field values are

org1 org2 org-cda-xx org4
org2 org1 org6 org-cda-yy
ORG-CDA-zz org1 org6 org8 org9

 

Expected output is

org-cda-xx

org-cda-yy

ORG-CDA-zz

10 REPLIES 10
KarolinaRoza
11 - Bolide

Hi,

 

Please try below without regex:

 

KarolinaRoza_0-1624531410191.png

let me know if it works for you

Karolina

Emil_Kos
17 - Castor
17 - Castor

Hi @RamyaGunasekaran,

 

Hi Please find the workflow attached:

 

Emil_Kos_0-1624531573061.png

 

The workflow is looking for a pattern like this any 3 signs - any 3 signs - any 2 signs.

 

RamyaGunasekaran
7 - Meteor

We cant apply condition with - because there will be - in other words also like below and lengths are not fixed

 

org1-org org2 org-cda-xx org4
org2 org1 org6-orgee org-cda-yyy
ORG-cda-zzdf dforg1 org6 org8 org9

 

In this case also my expected output should be. Please help with some suggestions

org-cda-xx

org-cda-yyy

ORG-cda-zzdf

Emil_Kos
17 - Castor
17 - Castor

Hi @RamyaGunasekaran,

 

Could you check if my workflow works for you? 

RamyaGunasekaran
7 - Meteor

We cant apply condition with - because there will be - in other words also like below and lengths are not fixed

 

org1-org org2 org-cda-xx org4
org2 org1 org6-orgee org-cda-yyy
ORG-cda-zzdf dforg1 org6 org8 org9

 

In this case also my expected output should be. Please help with some suggestions

org-cda-xx

org-cda-yyy

ORG-cda-zzdf

KarolinaRoza
11 - Bolide

hi,

 

so in that case please try Regex with formula:

 

 

 

\S*\-\S*\-\S*

 

 

RamyaGunasekaran
7 - Meteor

Sorry for confusing you. 

 

In my expected output common word is org-cda- after this hyphen whatver word may come 

 

In that case how it works?

KarolinaRoza
11 - Bolide

Hi,

 

see attached workflow with Regex formula as:

org-cda-\S*

please confirm if it works.

Karolina

MarqueeCrew
20 - Arcturus
20 - Arcturus

Alternative:

 

regex_teplace([field], "\s*org\d\s*", 'm)

 

 

 will eliminate 

space if it exists plus org followed by a number followed by a space of out exists. 

cheers,

 

 mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
Labels