Alteryx Designer Desktop Discussions

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

Need Help with Regex Match Filter on 2 fields

pvara
8 - Asteroid

My Sample Data Set as Follows

Invoice Number Credit Memo Number
340BVIR0000004571 12345
NOMemoNomemo
6765767612346

 

Regex_Match ([Invoice Number], "^\d\d\d\d.*")

AND

REGEX_Match([Credit Memo Number], "^\d\d\d\d.*")

 

I would like to see the TRUE to look something like this.

 

Invoice Number Credit Memo Number
  12345
6765767612346
20 REPLIES 20
MarqueeCrew
20 - Arcturus
20 - Arcturus

Hi @pvara ,

 

Please start with a filter containing this formulae:

 

// Credit memo is 4 or more digits 

REGEX_Match([Credit Memo Number], "\s*\d{5.}\s")

// Added allowance for spaces \s* because your data has them

AND 

// Invoice Number contains 4 or more digits 

Regex_match([Invoice Number ], ".*\d{4,}.*")

 

Let's see if it gets you the TRUE records that you're after.

 

Cheers,


Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
grossal
15 - Aurora
15 - Aurora

Hi @pvara,

 

I think you should go with a Multi-Field-Formula and a Filter for this:

 

grossal_1-1588620310331.png

 

 

Result:

grossal_2-1588620321409.png

 

Settings:

grossal_3-1588620343264.png

 

The formula is basically the same as yours. 

 

Workflow sample attached. Let me know what you think.

 

 

Best

Alex

AbhilashR
15 - Aurora
15 - Aurora

Hi @pvara, I started putting something together as a solution but I now see being late to the party. Sharing it here as another response just to put it out there. But please credit others if their solutions work for you.

AbhilashR_0-1588621435549.png

 

 

pvara
8 - Asteroid

HI Alex,

I am warming up to your solution, however, I would like to see the False as an output, I plan to do further downstream processing.

 

Any thoughts?

pvara
8 - Asteroid

Hi Mark

The regex expression does not work, I am getting all FALSE results.

MarqueeCrew
20 - Arcturus
20 - Arcturus

I tested with your sample data. Can you add a csv of more data?

 

 Thanks?

 

mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
grossal
15 - Aurora
15 - Aurora

If you want to have both in one stream, than just remove the filter. If you want to treat them differently, than use the F-Anker from the Filter Tool to process the False outputs.

 

Another option would be to enable "Copy Output to new Fields and Add"

 

grossal_0-1588623871322.png

 

The output would look like this:

grossal_1-1588623892738.png

 

I'll attach an updated sample workflow for you. Let me know what you think.

 

Best

Alex

 

 

pvara
8 - Asteroid

here is a csv with some data

pvara
8 - Asteroid

maybe I am missing something, how would I use the filter tool to process the False results?

Labels