Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Community is experiencing an influx of spam. As we work toward a solution, please use the 'Notify Moderator' option on the ellipsis menu to flag inappropriate posts.
Free Trial

Alteryx Designer Desktop Discussions

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

Really strange behavior using the Filter Tool with OR and negated Operators

JayKim
5 - Atom

Hi

 

I'm quite new to Alteryx and recently I have identified a strange behavior using the Filter Tool:

 

img.png

 

It seems like filtering on two different fields with OR and using Does Not Equal operator aren't working. But it works when I just use the Equal operator. Is anyone able to give me an explanation to this case? Moreover is there an elegant way to solve this problem?

 

Kind regards

Jay

5 REPLIES 5
LordNeilLord
15 - Aurora

Hey @JayKim

 

What is the final output you are looking for?

 

@LordNeilLord

Part time Tableau, Part Time Alteryx. Full Time Awesome


Data Lover

 

 

vishwa_0308
11 - Bolide

Hi @JayKim,

 

It seems the filter you have applied is completely fine..let me explain for the first one :

Department!="A" or Status!="on". in this query it first returned B&C and then for status!=on it returned as A(222) having "Off" status. After first criteria the data gets filter out then it applies the other criteria on the remaining .

 

Same is the case with equal to query.  If you want to restrict the output basis on both the criteria then you should apply "AND" operator.

 

Thanks,

Vishwa

JayKim
5 - Atom

 


@LordNeilLordwrote:

Hey @JayKim

 

What is the final output you are looking for?

 

@LordNeilLord

Part time Tableau, Part Time Alteryx. Full Time Awesome


Data Lover

 

 


Actually I'm more interested in an explanation why the combination of the Filter Tool, OR, Does Not Equal is not working. I suppose to work with only the True-result set and not with the exluded result set.

 

So using [Department] != "A" OR [Status] != "on" I would expect only one data set like the following:

 

PersID: 4444 / Department: C / Status off

danrh
13 - Pulsar

@vishwa_0308 is correct, the filter is working as expected.  The OR statement allows records where either condition is met.  In your example data, PersID 3333 and 4444 have departments that != "A", and PersID 2222 has a status that != "on", so all three records met at least one of the conditions and all three get through the filter.  It sounds like you're looking to filter based on both criteria, which requires an AND statement.  If you change the OR to an AND it will filter down to just the record you identified:

image.png

JayKim
5 - Atom

Seems like I had a dense moment. Thank you @danrh @vishwa_0308

Labels
Top Solution Authors