In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

adding serial number after character

kauser
8 - Asteroid

Hello, 

i have to add a serial number after a certain character to keep them separate - 

 

Current Output 

Item
ABC
ABC

 

Expected Output - 

 

Item
ABC1
ABC2

 

i am using this following formula into formula tool but its not working 

 

if StartsWith([Item], "ABC") then REGEX_Replace([Item], "$1$2", "ABC") else [Item] endif

4 REPLIES 4
alexnajm
19 - Altair
19 - Altair

How about add a RecordId tool, then use a Formula to add them together? [Item]+ToString([RecordID])

kauser
8 - Asteroid

yes i can but issue is Item column have lots of lines beside ABC then it will add number all of these items but i want to add number only to ABC to keep unique 

alexnajm
19 - Altair
19 - Altair

Then just add more to your Formula - IF StartsWith([Item],"ABC") THEN [Item]+ToString([RecordID]) ELSE [Item] ENDIF

Qiu
21 - Polaris
21 - Polaris

@kauser 
Follow the idea of @alexnajm we can do something like this.

1107-kauser.png

Labels
Top Solution Authors