Alteryx Designer Desktop Discussions

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

Looking for fields that ONLY contain certain items

smoskowitz
12 - Quasar

Hi all --

 

I hope I am missing something, but I thought this would be easier. What I want to do is filter on a field if it contains only a particular set of strings. In other words, let's use the strings A, B, C -- case insensitive.

 

My data is in a single field, concatenated with a comma.

 

If I use an AND, it will bring back anything that at least matches the below string but could have other items. If I use an OR, it will match any of the items and return rows with other information as well.

A, B, CMatch
A, B, C, DNo Match
B,A,CMatch
C,R,Q,A,BNo Match

I'm sure I am missing something, so thank you for your help.

 

Regards,

Seth

5 REPLIES 5
TheOC
15 - Aurora
15 - Aurora

hi @smoskowitz 

If you just want the filter to occur where the field is only a specific string, you might want to use "[field] = "A, B, C" " instead of using contains.

 

Are you able to attach a workflow with a sample input/output?

Cheers,
TheOC


Bulien
smoskowitz
12 - Quasar

Hi @TheOC --

 

Thank you for the suggestion, but the problem is the order might be different and it won't actually be equal. The workflow is to big and complicated to share. I figured an unrelated way around it.

 

Have a nice day!

 

Regards,

Seth

mandycgray
8 - Asteroid

I think there are  a few ways to do this.  What if you used a Data Cleanser to clean away all whitespace. punctuation, etc. so that you're left with only the letters.  That would mean any cell containing A and B and C would be a length of exactly 3.  Then your filter formula could be as follows:

 

Contains([Field1],"A") AND

contains([Field1],"B") AND

contains([Field1],"C") AND
Length([Field1])=3

 

mandycgray_0-1646762120952.png

 

TheOC
15 - Aurora
15 - Aurora

hey @smoskowitz 

Ahhhh i see! I didn't follow that part the first time reading, my apologies.

 

the solution from @mandycgray seems viable, glad you got it sorted.

Cheers,
TheOC


Bulien
Qiu
20 - Arcturus
20 - Arcturus

@smoskowitz 
IMHO, the data of yours should be much complicated and hard coding may not be able to address that.

I am thinking a more dynamic way and tested it by adding one more test string.
if you can provide a sample of your real data, we can take a closer look.

0309-smoskowitz.PNG

Labels