RE Query Results: 'One of' vs. 'Not one of'

Options
I've noticed that sometimes my RE queries don't behave with the logic I would expect. For example, I built a query to return the details of all Proposals with an Ask Date this FY, where the Status is 'Not one of' two of the options we have. Looking at the results, I noticed that some Proposals I had recently updated were not included, and should have been, based on the criteria.


When I changed the Status criteria to 'One of' all the other options, the results display correctly.


Why isn't 'Not one of A or B' the same as 'One of C, D, E, F or G'? Logically, they are the same thing.

Comments

  • Interesting. Yeah, I can see that in the case where a record has multiple values associated with it. But in the case of Proposal records, each Proposal only has one Status value, so it seems like the logic should still work.

    Example:

    Let's say I want to list all Proposals with a Status of 'Solicitation Made', 'Commitment Made', or 'Gift Made'. I don't want to list those with a Status of 'Declined' or 'Withdrawn'. In this example, these are all the possible values on a required field (there are no blanks).

    Status is one of 'Solicitation Made', 'Commitment Made', or 'Gift Made'
    ... should give me the same results as...
    Status is NOT one of 'Declined' or 'Withdrawn'
    ... right?
  • JoAnn Strommen
    JoAnn Strommen ✭✭✭✭✭
    Ancient Membership Facilitator 4 Name Dropper Photogenic
    Not to laugh at your expense, Karl, but I did just laugh.


    Logically it should work but not always when it's within RE.  I've gotten some really strange results using several of the negative criteria.  Even in some other reports.  Per BB support I spoke to "RE is functioning as designed."  Maybe the programmer way back when had faulty logic.


    Hope you get what you need...thanks for the laugh and welcome to the quirks/glitches of RE.
  • I've discovered that "Not one of" does not actually work on many cases.  When I called BB help, I was told, that, yeah, it's a know thing.


    So, it's a known bug. 


    Not helpful, I know, but there it is.


     
  • This kind of thing is extremely worrying. Sometimes these queries form the basis of reports that are shared with our Chancellor. According to all logic, I might be confident that they are displaying the correct data, but if the database doesn't always adhere to logical assumptions then we're going to get tripped up.


    How about fixing some of these 'known issues', guys? We should not have to just laugh off and accept these things - we paid a lot of money and spent a lot of time converting to this system, and I often think we may have been better off before we did so.
  • It's not just proposals.  I was doing a Constituent Query trying Not One Of on a relationship attribute and another on a solicit code to name a couple, and it didn't work.


    Shani
  • I imagine it would be the same issue when using a Constituent query on Relationships.  Did you try the same criteria using a Relationship type query?
  • Do the Constituents have more than one proposal?  The SQL engine is probably looking at ALL proposals and not necessarily using the Not One Of condition on each proposal individually, but at all proposals.  This is another one of those issues where one-to-many can bite you on the butt when you don't have the capability to query on the "many" side of things.  RE has to go through a lot of work to take the graphic interface of RE and turn it into valid SQL queries and sometimes it doesn't work the way we want/expect it to.  I've found that in some instances if you group criteria together within parentheses (even when you think it wouldn't be necessary), particularly when you're dealing with one-to-many issues, can sometimes make RE give you the results you are looking for (narrowing the conditions to each of the "many" rather than anywhere within the entire set).


    Like Joshua said, lacking the ability to do a Proposal Query and Export, severly limits usability.  So add your votes!!
  • Karl Craven:

    Interesting. Yeah, I can see that in the case where a record has multiple values associated with it. But in the case of Proposal records, each Proposal only has one Status value, so it seems like the logic should still work.

    Example:

    Let's say I want to list all Proposals with a Status of 'Solicitation Made', 'Commitment Made', or 'Gift Made'. I don't want to list those with a Status of 'Declined' or 'Withdrawn'. In this example, these are all the possible values on a required field (there are no blanks).

    Status is one of 'Solicitation Made', 'Commitment Made', or 'Gift Made'
    ... should give me the same results as...
    Status is NOT one of 'Declined' or 'Withdrawn'
    ... right?

    Well...maybe. In the second case, it's possible that it'll also pull constituents that don't have a Proposal at all. After all, their Proposal status is neither "Declined" nor "Withdrawn".


    I've run into similar issues with "Not One Of" in my experience and if I dig and dig and dig and dig, I can usually find a cause for it. And it's seldom intuitive. That's why I've gotten to a point of avoiding it almost entirely. "Not One Of" seems to work best if it's the only criteria used in a Query or one of just a small handful of criteria. The more complex a Query gets, the more likely it becomes that you'll get undesired results from it. Another option is trying a parenthetical set of "<field> does not equal <value>" criteria. It's clunky, but it replaces the "or" logic of "Not One Of" with "and" logic.

  • I never ever ever use negative operators in RE. I have never been able to get them to work. BB and everyone else I have ever talked to has said they dont' work as expected. I tell all new employees who will be querying not to use them and if they do use them in spite of my warnings they should expect quirky results. I use merge queries with the SUB operator to deal with "I don't want to see these results" and that always seems to work.


    We have been using RE since 1999 and that is my one hard and fast rule. ;)


    Just my 2 cents.


    Laura

    Laura Caswell

    Info Tech

    Worcester State University

    Worcester MA

  • Hi Rachel.


    Thanks for the clarification on One of vs Not one of. And all that clarification just makes me want to stick with my "do not use 'not' in a query and merge everything" rule. Too much thinking to keep it all straight. wink

    laura

     
  • What I find most frustrating about Not One Of is that it seems to work differently depending on which field I am using.


    I have a constituent record with 2 constituent codes (A and B) and 2 financial information types (C and D).

    Querying on this record using "Constituent Code not one of A" results in zero records being returned.

    Querying on the same constituent record using "Financial Information Type not one of C", yields one record: financial info type D.


    I'm sure the SQL behind it is perfectly logical and working as intended, but it's not very helpful.

Categories