Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Create a new field based on certain criteria

hash_89
8 - Asteroid

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.

3 REPLIES 3
JoBen
11 - Bolide

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

mmenth
11 - Bolide

You could try this formula:

 

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

 

Capture.PNG

ivoller
12 - Quasar

How about a formula like

 

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

Labels