Alteryx Designer Desktop Discussions

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

How to match values which is comma seperated

Sshasnk
8 - Asteroid

Input: 

 

FruitConcat_fruit
appleApple, mango,banana,cherry
ppleApple, mango,banana,cherry
cherryApple,mango,banana,cherry
ananaApple,mango,banana,cherry
mangoApple,mango,banana,cherry

 

I know we can do this using filter but I am using contain function and it is taking pple as true 

Output: 

FruitResult
appletrue
pplefalse
cherrytrue
ananafalse
mangotrue

 

6 REPLIES 6
atcodedog05
22 - Nova
22 - Nova

Hi @Sshasnk ,

 

Here is a workflow for the task. 

 

Input : table given by you

Output:

atcodedog05_0-1601884505202.png

Workflow :

atcodedog05_1-1601884525794.png

 

Hope this helps 🙂

 

If this post helps you please mark it as solution. And give a like if you dont mind 😀👍

jdunkerley79
ACE Emeritus
ACE Emeritus

One option would be to use Regular Expressions.

 

If you replace the , with | then it will work as a one of expression. I chose to use a Regex replace as this will allow the spaces to be replaced to:

REGEX_Replace([Concat_fruit], ",\s*", "|")

 

Then you can use this in a Regex match with the Fruit:

REGEX_Match([Fruit], REGEX_Replace([Concat_fruit], ",\s*", "|"))

 

Have attached a sample doing this

Assaf_m
11 - Bolide

check the attached solution, 

 

let me know if it helps

Assaf_m_0-1601884918349.png

 

Emil_Kos
17 - Castor
17 - Castor

Hi @Sshasnk,

 

My is super complicated comparing to other people solutions 🙂

 

 

Emil_Kos_0-1601885016061.png

 

atcodedog05
22 - Nova
22 - Nova

Happy to help 🙂 @Sshasnk 

 

Cheers and Happy Analysing 😀

jdunkerley79
ACE Emeritus
ACE Emeritus

Think the simplest might be:

REGEX_Match([Concat_fruit], ".*\b" + [Fruit] + "\b.*")

 

The \b makes it check for a word boundary (comma or space) so works in this case well. 

Labels