Important Community update: The process for changing your account details was updated on June 25th. Learn how this impacts your Community experience and the actions we suggest you take to secure your account here.

Alteryx Designer Desktop Discussions

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

How to find a String and bring the next 5 strings next to it?

Joker_Hazard
11 - Bolide

Hello Guys.

I am trying to retrieve some data based on two strings: "Alq" and "IR".

The ideia here is, Alteryx finds the string "IR" or "ALQ" within a field, once it detects it should bring the words next to it.

So for this example:

IR RECOLHIDO PELO CLIENTEx000D_I.R. R$: 29,610.43_x000D_Alq.: 15%

 

Alteryx finds "IR". Then it should bring the next 20 words so a new field is created with "IR RECOLHIDO PELO CLIENTE" and the same thing with "ALQ" but with 10 words only.

Is it possible? I tried using Findstring and CONTAIN but I can think of any formula to bring words next to it.

Thanks

8 REPLIES 8
DawnDuong
13 - Pulsar
13 - Pulsar

Hi @Joker_Hazard 

You certainly can achieve it with Regex under Parse mode. Assuming that IR always come before Alg

The Regex string can be something like

^.*(IR.{20}).*(ALQ.{10}).*$

dawn 

Joker_Hazard
11 - Bolide

Hello @DawnDuong .

I feel like REGEX is one of the best tools in Alteryx, but at the same time one of most unpopular tools. Such interesting things can be created with it. 

I tried replicating that to my workflow, but for some reason it comes as blank: Would you know if I'm missing something?

Joker_Hazard_0-1660751829292.png

 

DawnDuong
13 - Pulsar
13 - Pulsar

For this example You need fo use it under parse mode, to extract the 2 groups 

 

Joker_Hazard
11 - Bolide

@DawnDuong I tried and its still coming as blank. I'm very sorry, I'm not accustomed to use REGEX tool.

Can you guide me through it? I attached my sample

Joker_Hazard
11 - Bolide

Anyone can help me pls?

 

Emmanuel_G
13 - Pulsar

Hi @Joker_Hazard ,

 

The problem is that if what follows Alq is not at least 10 characters long, the regex pattern is not going to match. ( Find attached the workflow )

 

If you want to match at most the 10 characters that follow Alq, you can use the pattern {1,10} to say that you retrieve all the values ​​after within the limit of 10 characters.

 

In our case, we have Alq.: 15% so less than 10 characters after the Alq. So pattern {10} will not work.

 

Is that clear enough and good enough for you?

Emmanuel_G_0-1661089424674.png

 

Joker_Hazard
11 - Bolide

it sure is Mr Goku. Thank you very much!!!

Emmanuel_G
13 - Pulsar

@Joker_Hazard 

 

Funny 😁... You're welcome dear !

Labels