Alteryx Designer Desktop Discussions

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

Multiple Conditions Filter

tsilverman_
7 - Meteor

Hello Alteryx Community,

 

  I am fairly new to the alteryx platform and am finding myself stuck on a particular filter request. To first explain, each row contains a key ID, that can have multiple values in another column (X). I need to filter a column with set values in one column (X), for example, "1111", "2222", "3333". However, after  have done this, I then need to filter those unique ID's to also include values "010101", "020202" etc. in column (X). The issue is that, after I filter the very first time, it only leaves me with "1111", "2222", "3333" and their key ID which then I cannot find "010101", "020202" in column X because of the previous filter.

 

I need a filter basically that states; of those values "1111", "2222", "3333" in column (X), which results in filtered Key ID's, which of those Key IDs also have values "010101", "020202". 

 

I hope this makes sense. I can provide additional details if necessary. 

21 REPLIES 21
atcodedog05
22 - Nova
22 - Nova

Hi @tsilverman_ 

Can you provide some sample input and expected output It will help us get a better understanding of the usecase.

We will be happy to help : )

tsilverman_
7 - Meteor

As you can see in the attached workbook, there are Key ID's that are duplicated. Column [X] needs to satisfy the first condition of having either "1111", "2222", "3333" and also having "10101", "20202", "30303". I just want to keep the Key ID's that satisfy both conditions. 

atcodedog05
22 - Nova
22 - Nova

Hi @tsilverman_ 

 

Here is how you can do it.

Workflow:

atcodedog05_0-1640977049042.png

 

1. Using select tool to convert x to string datatype

2. Using summarize tool to get list of values for each id

3. Using filter to check both conditions

4. Using text to column tool to split the values back to each rows

 

 

Hope this helps : )

Qiu
20 - Arcturus
20 - Arcturus

@tsilverman_ 
Here is a bit different approach.
I think the using a mapping file for the cretirias should be more easy for maitenance.

0101-tsilverman_.PNG

atcodedog05
22 - Nova
22 - Nova

Interesting approach @Qiu  🙂👍

binuacs
20 - Arcturus

@tsilverman_ Another approach, appreciate @atcodedog05  and @Qiu's approaches

 

binuacs_1-1641044361023.png

 

 

tsilverman_
7 - Meteor

Thank you,

 

 

     After trialing this method I am getting a different result. My real data set, for the Key ID column, contains complex characters, letters and numbers. I used the data cleanse tool to eliminate whit space and special charaters so that it only contains letters and numbers. Having everything else equal, it seems that the final result produces unwanted "X" column numbers. Actually, it outputs ones that I did not even select at all. the "X" column also contains many numbers and letters as well as some rows have blank spaces. Do you believe this is an issue with the data set not formatting correctly?

atcodedog05
22 - Nova
22 - Nova

Hi @tsilverman_ 

 

Here is a modified version of @Qiu workflow can you give this a try.

 

atcodedog05_1-1641310668883.png

 

Hope this helps : )

tsilverman_
7 - Meteor

thank you @atcodedog05

 

When I do this, I receive an error on the filter tool. I have pasted it below. It says I have two equal signs but I only had one. Also, when I type in {Sum_Flag]= part, it lights up, but for the "1,2" - it does not highlight itself, I am not sure if it is picking up the values for the flag.

 

tsilverman__0-1641312680830.png

 

Labels