Alteryx Designer Desktop Discussions

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

Regex (replace)

vcorrei5
7 - Meteor

I would like to use regex to identify all rows that contain BRA (including the registers w/ numbers) - I used the expression: ^BRA*

 

vcorrei5_1-1659874914442.png

 

I would like to replace all BRA derivations (including the registers w/ numbers) w/ only BRA. However it is not working.

 

Could you help me?

 

4 REPLIES 4
FilipR
11 - Bolide

Maybe I misunderstand your intent, but if you already identify the rows with BRA something, and want just to leave the "BRA" letters instead of the whole string, then why not do it through an easy formula:

 

IF Contains([Name], "BRA") THEN 'BRA' ELSE Null() ENDIF

 

OR:

 

IF REGEX_CountMatches([Name], 'BRA') THEN 'BRA' ELSE Null() ENDIF

MarqueeCrew
20 - Arcturus
20 - Arcturus

@vcorrei5 ,

 

i like your first function (contains) ,   But if BRA is always at the beginning @FilipR , you can use:


left([field],3) = "BRA"

 

or

 

startswith([field],"BRA")

 

 as part of an IIF EXPRESSION

 

 IIF(left([field],3) = "BRA","BRA",[field])

 

 cheers,

 

 mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
vcorrei5
7 - Meteor

It can be. It works! I did not know the formula/expression to do it.

 

Do you know a guide to test or simulate the formulas/expressions to help on learning process?

 

Thanks !! 

vcorrei5
7 - Meteor

Thanks!! It works also!!

 

Do you know a guide to help on learning expressions/formulas?

 

 

Thanks again!

Labels