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 after December 31, 2025. 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

Replace last characters of a string dynamically

Istwineres
8 - Asteroid

Hi, I have this string: 06SS0000000000 and I'd like to replace the last characters with count from the count records tool so: if 1 record counted the string should be 06SS0000000001 if 12 records are counted the string should be 06SS0000000012 if 123 records are counted the string should be 06SS0000000123. Thanks!

4 REPLIES 4
Ladarthure
14 - Magnetar
14 - Magnetar

I would do something like the formula below.

 

You can use record ID to add it and transform it to string via a select tool. 

 

Substring([Field1],0,Length([Field1])-1)+[RecordID]

Istwineres
8 - Asteroid

Why -1 in substring?

Luke_C
17 - Castor
17 - Castor

The -1 would drop the last character of the string off. If you wanted to drop however many characters are in the record ID off the end of the string just substitute the -1 with - length([RecordID]) 

Istwineres
8 - Asteroid

yes, I did that way!

Labels
Top Solution Authors