Alteryx Designer Desktop Discussions

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

IF Contains

sahartz
8 - Asteroid

Hi,

 

I have some fields that contain several of numbers in each field (e.g., 

line 1 - 1,7,10,17,18,23,66,81,121,122,125,127,130,131,132,133,134,141,289,317,318,324,328,333,334,335,344,348,351,355,356,357,358,369,432,441,462,476

Line 2 - 

1,5,6,7,11,15,16,17,18,21,23,31,37,52,56,60,72,83,89,96,127,130,131,137,141,156,239,245,256,257,258,259,263,289,298,314,315,316,317,318,324,333,335,344,346,350,364,365,368,369,370,384,406,436,453,456,462,47

 

and I wand to know in which filed I have the number 1, 23 and 462.

 

Will appreciate your help 

Thanks

Sahar

6 REPLIES 6
MarqueeCrew
20 - Arcturus
20 - Arcturus

@sahartz ,

 

 yes you can use contains as:

 

if contains() and contains() and contains() then .... else ... endif

 

make sure that you search for numbers that won't find false positives though, like 23 matching to 123. 

regex_match([field],"1,.*\b23\b.*\b462.*")

 

 that will find then if they are in sequence. 

cheers,

 

 mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
sahartz
8 - Asteroid

@ 

Thanks for your quick reply 🙂

I never used the REGEX_Match and will appreciate your help.

If I need only 23 and not 123 how I write the formula? 

 

MarqueeCrew
20 - Arcturus
20 - Arcturus

\b is a word boundary. 
\s is a space

 

 i wrote it as 23 preceded by a boundary. 

\s23, looks for space twenty three comma 

 

Does that explain?  If my expression isn't working, please let me know. 

cheers,

 

 mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
sahartz
8 - Asteroid

Hi

 

I wrote REGEX_Match([Permission IDs], ".*\b23,") but I am getting "0" (false).

Is there a place to learn more about REGEX_Match?

 

MarqueeCrew
20 - Arcturus
20 - Arcturus

@sahartz ,

 

 your expression will match

 

 xxxxxxxx 23,

 

 to match things with stuff after it,

 

".*\s23,.*"

 

but if you just want " 23," you might as well use contains. 

cheers,

 

 mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
sahartz
8 - Asteroid

Thanks!!!!

 

I used REGEX_Match([Permission IDs], ".*,23,.*") and it works 🙂

Labels