Alteryx Designer Desktop Discussions

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

Find digit in string

sstevens02
5 - Atom

We have the numeric output from a survey with a "select all that apply" question. There were 12 selections. The output could have from 1 to 12 digits such as 1,5,6 or 3,7,8,10,11. The numbers are separated by a comma but no space. I want to search each cell and if there is a "1" present to output TRUE or 1 to the column representing that answer. For example, let's say 1= apple, 2= orange, 3= banana, 4= plum, 5 = grapes, 6= strawberries. So for the first string it would put true in the apple column, true in grapes and true in strawberries. 

 

I am thinking I will need 12 different formulas. Search each cell for a "1" and put the results in the apple column. Then search each cell for 2 and put the results in the orange column. etc. I tried a regex formula REGEX_Match([Fruit, "\d{1}") to get started and it returned false (0) for each cell. 

 

Example attached: Column 1 is input, columns 2-13 are desired output.

 

Thanks!

4 REPLIES 4
IraWatt
17 - Castor
17 - Castor

Hey @sstevens02,

I think this workflow generates the output you want:

IraWatt_0-1654295657876.png

Any questions or issues please ask :)
HTH!
Ira

sstevens02
5 - Atom

Thank you! My coworker told me the community was fast to help but I didn't think I would get an answer this quickly!! You're amazing!!

IraWatt
17 - Castor
17 - Castor

No worries @sstevens02 😄 

IraWatt
17 - Castor
17 - Castor

Also thanks for adding example input and output data always makes it easier/quicker to understand the problem ! 

Labels