Alteryx Designer Desktop Discussions

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

Extract next value after a keyword

Ekta
8 - Asteroid

Dear All, 

 

I am having issue with extracting the data,  Please help me with the following question - 

 

My data is the text file and i would like to extract the data from it, 

is there any way to search the keywords and then extract the next value? Below is the sample input and the sample output

Input - 

Field
A 1 B 2 C 3
Apple 99 DONUT 165.00 TAXI
RELY 12 Next trip 664 @ 99% 146
^ All of  Ear  1,000.00

 

Output

FieldValue
A1
B2
C3
Apple99
DONUT165.00
RELY12
Ear1,000.00

 

Appreciate you help, 

 

Thank you in advance

8 REPLIES 8
apathetichell
18 - Pollux

Are you repeating this process multiple times for a minimal amount of data each time or do you have a ton of keyword selectors? It really helps determines how to implement it... Also - it is always a number that follows? I can give you regex to search and select numbers following your keywords but it would be specifically tuned for these keywords and these examples.

Ekta
8 - Asteroid

Hi @apathetichell  thanks a lot for reply, yeah it will always be a number after the keyword and i will be having a few keywords similar to the sample above, 

 

Thank you so much

apathetichell
18 - Pollux

O.k. - so this works for your data but I can't guarantee it will always be 100% perfect. I have to say that I enjoyed building this as I was trying to figure out how to pass a variable into a regex_replace and I was moderately happy with my solution.

Ekta
8 - Asteroid

Thanks a lot for the wonderful workflow but if i have Input like this and we want to extract the next value after the keyword, how we can do it please?

 

ID Number: AXXX12B
Date . 05 Jun 2020
YEAR OF ATTENDENCE 1982
apple. Class (APPLE) 10.00 by 05 Jul 2020

 

output - 

ID NumberDateYEAR OF ATTENDENCEClass (APPLE)by
AXXX12B05 Jun 2020198210.0005 Jul 2020

 

 

Thank you in advance

 

Ekta
8 - Asteroid

@apathetichell 

Thanks a lot for the wonderful workflow but if i have Input like this and we want to extract the next value after the keyword, how we can do it please?

 

ID Number: AXXX12B
Date . 05 Jun 2020
YEAR OF ATTENDENCE 1982
apple. Class (APPLE) 10.00 by 05 Jul 2020

 

output - 

ID NumberDateYEAR OF ATTENDENCEClass (APPLE)by
AXXX12B05 Jun 2020198210.0005 Jul 2020

 

 

Thank you in advance

ArtApa
Alteryx
Alteryx

Hi @Ekta - I tried to make it easy to understand. 

ArtApa_0-1625136561627.png

 

apathetichell
18 - Pollux

Hi @Ekta,

 

your original data was considerably less structured than this and relied upon keywords searching the same set of data and then extracting - this should be more straight forward but I'm unsure if the search terms are manually entered, come from a different datasource or static? This drastically changes how the workflow is set up. 

 

 

Ekta
8 - Asteroid

@ArtApa Thanks so much for the workflow, it worked perfectly fine:)

 

Labels