The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Using 'is not' vs 'is' in reporting / filtering

Community Alums
Not applicable

I'm having a bit of a reporting / filtering crisis of confidence.

 

If I create a report or filter that selects all changes that are type standard AND standard template name 'ISX OR standard template name 'ISY, then it works as expected. 

 

If do all changes that are type standard AND standard template name 'IS NOTX OR standard template name 'IS NOT'then I it gets ignored and I get both X and Y types in the list. However, if I use AND rather OR between the template names it works.  I have sounded this out to colleagues who all seem to think this isn't correct, but I may just be missing something about the use of IS NOT that I don't understand.

 

Thanks in advance.

3 ACCEPTED SOLUTIONS

Mark Manders
Mega Patron

It is correct and strangely enough, this is the fourth time in 3 days I see this coming by. Just simplify:

 

If A is not 1 OR A is not 2, then blablabla.

 

If A is 1, this will return true, because it is not 2.

If A is 2, this will return true, because it is not 1.

If A is 3 (or anything else), it will return true, because it's not 1 and not 2.

 

The OR condition with a negative will always return true on a given value, while if A is not 1 AND A is not 2, it will only return true if it's neither (so 3 or anything else).

I hope this clears the confusion?


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

View solution in original post

Brad Bowman
Kilo Patron
Kilo Patron

Hi Richard,

Many a programmer have scratched/beat their heads over this, so you can probably find a very technical answer out there in any platform/language.  This is basically the same as not equal / != / <>.  Logically, whenever you have 2 negative conditions AND must be used since in this case the standard template name will always NOT be X or Y.

 

View solution in original post

Robbie
Kilo Patron
Kilo Patron

Hi @Community Alums,

 

One thing to note with 'OR' conditions are the level they're determined on.

Essentially, when building reports leveraging the condition builder, it uses two different types of OR conditions: top-level and dependent.

 

Take a look at this ServiceNow page that explains in more detail:

https://docs.servicenow.com/bundle/washingtondc-platform-user-interface/page/use/using-lists/concept/c_UsingORConditions.html

 

To answer you're question directly and assuming that you're implementing this at the dependent level, than an AND operator would be correct (Also, when you voice this out at a logical level, it makes sense).

 

To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Kudos.


Thanks, Robbie

View solution in original post

4 REPLIES 4

Mark Manders
Mega Patron

It is correct and strangely enough, this is the fourth time in 3 days I see this coming by. Just simplify:

 

If A is not 1 OR A is not 2, then blablabla.

 

If A is 1, this will return true, because it is not 2.

If A is 2, this will return true, because it is not 1.

If A is 3 (or anything else), it will return true, because it's not 1 and not 2.

 

The OR condition with a negative will always return true on a given value, while if A is not 1 AND A is not 2, it will only return true if it's neither (so 3 or anything else).

I hope this clears the confusion?


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

Brad Bowman
Kilo Patron
Kilo Patron

Hi Richard,

Many a programmer have scratched/beat their heads over this, so you can probably find a very technical answer out there in any platform/language.  This is basically the same as not equal / != / <>.  Logically, whenever you have 2 negative conditions AND must be used since in this case the standard template name will always NOT be X or Y.

 

Robbie
Kilo Patron
Kilo Patron

Hi @Community Alums,

 

One thing to note with 'OR' conditions are the level they're determined on.

Essentially, when building reports leveraging the condition builder, it uses two different types of OR conditions: top-level and dependent.

 

Take a look at this ServiceNow page that explains in more detail:

https://docs.servicenow.com/bundle/washingtondc-platform-user-interface/page/use/using-lists/concept/c_UsingORConditions.html

 

To answer you're question directly and assuming that you're implementing this at the dependent level, than an AND operator would be correct (Also, when you voice this out at a logical level, it makes sense).

 

To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Kudos.


Thanks, Robbie

Community Alums
Not applicable

Thank you everybody. You've made an old man happy.