I have a table which looks like this
Code | Group |
X123 | A |
Y123A | A |
Z345 | D |
G34E | E |
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'
Code | Group | Final_Code |
X123 | A | X123A |
Y123A | A | Y123A |
Z345 | D | Z345D |
G34E | E | G34E |
Can someone help me how to proceed further?
thankyou.
Solved! Go to Solution.
Hi @hash_89, why don't you try using this formula? IIf(Regex_CountMatches(Right([Code],1), "[a-z]")>0,[Code], [Code]+[Group])
You could try this formula:
IF REGEX_Match(Right([Code], 1), "[a-zA-Z]") THEN [Code] ELSE
[Code] + ToString([Group]) ENDIF
How about a formula like
[Code] + iif(regex_match(right([Code],1),"\d"),[Group],"")