Let’s talk Alteryx Copilot. Join the live AMA event to connect with the Alteryx team, ask questions, and hear how others are exploring what Copilot can do. Have Copilot questions? Ask here!
Start Free Trial

Alteryx Designer Desktop Discussions

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

Trim String at both ends

DHB
8 - Asteroid

I'm trying to trim a test string to retain a number from the middle.  The number has varying amounts of digits.

 

So 

 

/courses/12345/users/69565/usage?page=3&per_page=100

 

Becomes...

 

69565

 

The number in the middle will always be preceded by '/users/' and followed by '/usage'.

 

Any suggestions will be gratefully received.

 

Best,

 

DHB

3 REPLIES 3
JoshKushner
12 - Quasar

You can use the Text to Columns Tool to split the string by the delimiter '/' then by the delimiter '?'. Then use a Multi-Row Formula Tool to find the data point that follows your requirements (preceded by 'users' and followed by 'usage').

I've attached a sample workflow.

 

Flow:

Flow.PNG

 

Result:

result.PNG

 

Text to Columns:

text to col 2.PNGtext to col.PNG

 

 

Multi-Row Formula:

multi row formula.PNG

vishwa_0308
11 - Bolide

Hi @DHB,

 

You can try this specific solution for ur query : To get the numbers between '/users/' and '/usage'.

 

Regex1.jpg

DHB
8 - Asteroid

Thank you both for your solutions.  I've gone with the 1 tool workflow for simplicity and it does exactly what I need.

Labels
Top Solution Authors