Free Trial

Alteryx Designer Desktop Discussions

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

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
17 - Castor
17 - Castor

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
17 - Castor
17 - Castor

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