Alteryx Designer Discussions

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

Match One Value between Two Strings

Bonediggler
8 - Asteroid

Experts - 

 

Here's the case: I need to figure out if there is at least one common value present in 2 different strings.  For example:

 

String A: 123, abd, edf

String B: 345,edf,789

 

In this case there is a match on "edf". 

 

I am looking for a solution that:

> Doesn't involve parsing and then transposing the strings as that will create millions of records

> Leaves the strings as they are

> Doesn't involve lots of tools - as I already have a solution that involves lots of tools

 

If I am overlooking an existing function or simple process to get this done, please let me know!

 

Thanks in advance!

20 REPLIES 20
Luke_C
14 - Magnetar

Are these strings different fields in the same record? Or on different records that share a common ID or grouping?

 

If they're in the same record, you could filter to these records by doing something like:

Contains([String A],'edf') AND Contains([String B], 'edf')

Bonediggler
8 - Asteroid

Different fields in the same record.  The problem is I don't know if or what the matching value would be between fields.

 

"edf" was just an example - not necessarily a known value I am looking for.

atcodedog05
21 - Polaris

Hi @Bonediggler 

 

Can you provide the expected output? what is the output after comparing?

Bonediggler
8 - Asteroid

Boolean: match = true/no match = false

Luke_C
14 - Magnetar

Hmm I see, needs to dynamically check to see if there's something in common. I can't think of any solution that doesn't include parsing it out but maybe some of the other smart people here can. 

john_watkins
10 - Fireball

Are the values to be tested delimited, and if so, is there really a common delimiter?  Your sample leads me to believe it is  "," that is what tells the tokens apart.

Bonediggler
8 - Asteroid

 Sorry - yes, comma delimiter

Maskell_Rascal
13 - Pulsar

Hi @Bonediggler 

 

If the comma is your common delimiter, you can use a couple Text to Columns and a Filter to find only the strings that match. I mocked up 300,000 rows of data using this method, which ballooned up to 2.7M rows after the Text to Columns tools, and it ran in about 2 seconds.

 

Maskell_Rascal_0-1627583213714.png

 

Cheers!

Phil

Bonediggler
8 - Asteroid

I am working with millions of rows and up to dozens of values per string so this method might cause Alteryx to explode, but it definitely is one solution!

Labels