Skip to main content
Announcements
Global Transformation Awards submissions are open! SUBMIT YOUR STORY
cancel
Showing results for 
Search instead for 
Did you mean: 
dreweezy
Creator II
Creator II

exclude specific part of string

I have some data that looks something to similar below.

 

ACCOUNT_TITLE

AK 2019 TEST1

AK 2018 TEST2

AK 2017 TEST3

etc.

I'd like to extract this column - ACCOUNT_TITLE so that my values will only be TEST1, TEST2, TEST3.

I tried grabbing the first 7 characters than taking that length and subtracting it from the column but don't yield any results. This is a pretty simple problem I'm getting stuck on. Any help would be greatly appreciated.

Labels (1)
1 Solution

Accepted Solutions
DavidM
Partner - Creator II
Partner - Creator II

If you want to exclude first 7 characters of string you can do it like this:

Right(ACCOUNT_TITLE, Len(ACCOUNT_TITLE)-7)

Len gets the overall lenght of the string, then you need to identify how many you want to subtract. Hope this helps

View solution in original post

4 Replies
DavidM
Partner - Creator II
Partner - Creator II

There are couple of solutions, depending on what you're data look like.

You can try Right(ACCOUNT_TITLE,5) to get last 5 letters - TEST1

You can try subfield(ACCOUNT_TITLE,' ',3) to get third string part after space (if you have two spaces).

You can use Index to identify position of T (if there is no T in previous string - AK 2018) and do Left from there

dreweezy
Creator II
Creator II
Author

I've tried the methods 1 and 2. It would work but in my case I def need some adjustments in my syntax.

Problem is my data has different strings within, I should've mentioned that.

ACCOUNT_TITLE

AK 2018 TEST1

AK 2018 TEST SCENARIO

AK 2018 TEST DUMMY DATA

I guess I want to exclude the first 7 characters. Since everything after the first 7 characters can be either one word, 2, 3 etc.

I'm tried taking the first 7 character and then deduct that from the field, thinking it would give me the remainder of that string.

=ACCOUNT_TITLE - (left(ACCOUNT_TITLE , 7))  ---- but this doesn't seem to work as I expected.

Hope this clarifies a bit. 

DavidM
Partner - Creator II
Partner - Creator II

If you want to exclude first 7 characters of string you can do it like this:

Right(ACCOUNT_TITLE, Len(ACCOUNT_TITLE)-7)

Len gets the overall lenght of the string, then you need to identify how many you want to subtract. Hope this helps

dreweezy
Creator II
Creator II
Author

Thank you, this is exactly what I was looking for.