Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Regex

Pranab_C
8 - Asteroid

I need to extract value after "X" from this string, using either Regex or a Formula


1. Type of account a X Deposit 21 Account number or other designation
2. Check all that apply a Account opened during tax year b X Account closed during tax year

3 REPLIES 3
rfoster7
11 - Bolide

Substring([examples],FindString([examples], ' X ') + 3,255)

 

Screenshot 2024-11-27 144204.jpg

 

note I"m using " X " as the findstring text. YOu could just as easily look for just 'X' but I"m assuming your actual data will be more complicated that the example, so I'm trying to get you forward. 

 

The 255 is an arbitrary number to denote the unknown end of the string. If you have really large strings, you could use length([examples]) or something to get the actual endpoint. 

DataNath
17 - Castor
17 - Castor

Hey @Pranab_C, there's a bunch of different Formula expressions you could use for this, such as:


Right([Input],FindString(ReverseString([Input]), 'X')+1)

 

For RegEx, if you have the tool in parse mode with Case Insensitive unticked, you can use:

 

X\s(.*)

 

One thing I would say though is this looks to be a free text feel or at least contain varying strings. Is X a reliable enough separator i.e. this could be part of a legitimate string you want to capture?

Pranab_C
8 - Asteroid

Thank you both of you for your quick response.

Labels