ACC Expression Help - String after character | Community
Skip to main content
Level 3
Oct 23, 2019 4:46 PM UTC
Solved

ACC Expression Help - String after character

Can anyone tell me the best way in the expression editor to capture the numbers after a specific character.  For example, if the values is 1234-5678.  I want to keep only the characters after the dash(5678).  I tried some of the built in functions but have not had any luck.  Thanks!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Jonathon_wodnicki
Jonathon_wodnickiAccepted solution
New Participant
Oct 23, 2019 5:56 PM UTC

Hi,

Use these built-in functions:

Substring(@field, Charindex(@field, '-') + 1, Length(@field))

Thanks,

-Jon

3 replies

wpomeroyAuthor
Level 3
Oct 23, 2019 7:10 PM UTC

This worked perfectly, thank you.  My understanding of the way Substring worked was not correct.

Translate
Jonathon_wodnicki
Jonathon_wodnickiAccepted solution
New Participant
Oct 23, 2019 5:56 PM UTC

Hi,

Use these built-in functions:

Substring(@field, Charindex(@field, '-') + 1, Length(@field))

Thanks,

-Jon

Translate
New Participant
Sep 17, 2021 1:37 PM UTC

Hi @jonathon_wodnicki - Following on this question, as we have a similar but more complex requirement. We can have the string as 1234-5678-abcd or 1234-5678-abcd-0101

The text can increase in the right, and out objective is to find the text everything before the last dash, e.g. 1234-5678, or, 1234-5678-abcd

 

Any suggestions to resolve this using built-in functions in the Enrichment activity?

 

Thanks
Dheeraj

Translate