This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
A Data Model is a new approach for integrating data from multiple tables.
This parameter is a boolean flag.
I will be going to Germany with my boyfriend this May.
Nobu is a Japanese restaurant known all over the world for its unique food
How can I extract the last x words from each sentence. Is there a function similar to SUBSTITUTE in Alteryx wherein I can replace the xth occurrence of the space or is there another option? The REPLACE function replaces all instances of the character.
Wasn't sure if you wanted to extract the last word or replace it within the string so I have done both in the attached example. One uses Regex replace in a formula tool, the other uses the Regex tool to parse out the final word.
I realise this is an old question but it came up when I was searching for a solution to this problem today. I figured out a single-formula solution which I'm sharing in case it helps anyone else looking for this.
This works if you want the last word, and the string is separated by spaces. Basically it's 3 steps, nested:
ReverseString([Name]) - reverses the whole string
GetWord(<string>, 0) - this gets the first word of the string
ReverseString - reverse the word back to normal
You could probably modify it to get multiple words but it's a bit more fiddly... e.g. this gets the last 2 words, although you have to manually add the space and so you get an extra space if there is only one word in the string: