Alteryx Designer Desktop Discussions

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

Formula

Feras95p
8 - Asteroid

Dear all,

 

I have a cell which contains a string type a sentence I want to have only the word which is inside two bracket for example I have in the cell Feras is eating an (orange) and watching TV I want the output of the cell is to get rid out of all the words except the word inside the bracket which is Orang.

 

Any help in that please?

7 REPLIES 7
pedrodrfaria
13 - Pulsar

Hi @Feras95p 

 

You can do it using Regex or maybe a findstring and substring functions inside of the formula tool. I attached an example extracting the information inside of the parenthesis using regex. 

 

pedrodrfaria_0-1609190103223.png

 

Pedro.

 

Kenda
16 - Nebula
16 - Nebula

Hi @Feras95p 

 

 

In this case, I think RegEx would be helpful. Using a formula tool, try the following expression:

REGEX_Replace([Field1], ".*\((.*)\).*", "$1")

 

Basically, this takes your field and says find the parenthesis and only keep what is within those and get rid of everything else. 

 

Hope this helps! 

RishiK
Alteryx
Alteryx

@Feras95p I used regex to do this in the attached sample workflow for you.

morr-co
10 - Fireball

Hi @Feras95p - the regex tool will get you there. Attached is an example.

Feras95p
8 - Asteroid

Thanks @Kenda , it works well! 

 

One more question please I have an other cell which contains the address information like this 

 

address:Work,neigborhood:Joe ,street:Oxford ,company:Feras ,floor: five


I want to have only the output the company name which is in this case
Feras any idea how it can be done?

pedrodrfaria
13 - Pulsar

Hi @Feras95p 

 

You can use the Regex again and extract that info:

pedrodrfaria_1-1609191757502.png

 

If you want to still use the Formula Tool, you can do something like this: 

pedrodrfaria_0-1609192594221.png

 

 

Also, additionally, the recommendation is that you always open a new post if you have a different question. You can still ask here and mark more than one reply as the correct answer. But as a tip, open a new one to make sure you other question will always be answered.

 

Pedro.

 

Feras95p
8 - Asteroid

@pedrodrfaria Thank you ! it works great! 

 

Could you please have a look here 

 

https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Cross-tab/m-p/686119#M162199

Labels
Top Solution Authors