community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
#SANTALYTICS

The highly anticipated Alteryx Community tradition is back! We hope you'll join us!

Learn More
SOLVED

Create a new field based on certain criteria

Meteor

I have a table which looks like this

CodeGroup
X123A
Y123AA
Z345D
G34EE

 

I want to create another column 'Final_Code' combining both the columns.

Condition: If "Code" doesn't have an alphabet in the end, then the value in the new column should be a concatenation of  columns 'Code' & 'Group'

CodeGroupFinal_Code
X123AX123A
Y123AAY123A
Z345DZ345D
G34EEG34E

 

Can someone help me how to proceed further?

 

thankyou.

Bolide

Hi @hash_89, why don't you try using this formula? IIf(Regex_CountMatches(Right([Code],1), "[a-z]")>0,[Code], [Code]+[Group])

Bolide

You could try this formula:

 

IF REGEX_Match(Right([Code], 1), "[a-zA-Z]") THEN [Code] ELSE
[Code] + ToString([Group]) ENDIF

 

Capture.PNG

Highlighted
Quasar

How about a formula like

 

[Code] + iif(regex_match(right([Code],1),"\d"),[Group],"")

Labels