LAE

Welcome to the LAE community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Discussions

Members

Resources

Events

 View Only
  • 1.  Using NOT EQUAL (!=) to exclude specific figures from set of data

    Employee
    Posted 11-13-2013 16:13

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: tfainga

    Hi,

    I just need to exclude some specific prefixes from a set of data and I used not equal(!=) on my filter but when it's complete the running it still output the figures as shown on first node.
    Please can any one tell me why is this happen? Is there's any thing I miss?


  • 2.  RE: Using NOT EQUAL (!=) to exclude specific figures from set of data

    Employee
    Posted 11-14-2013 14:21

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: Tim Meagher

    Hi,

    How are you using this != clause?
    Are you using something like:

    emit *
    where 'field' != <someValue>

    It's difficult to know why you are running into problems without the script you are using...

    Tim.


  • 3.  RE: Using NOT EQUAL (!=) to exclude specific figures from set of data

    Employee
    Posted 11-17-2013 14:13

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: tfainga

    Hi,

    Here is the script;

    emit * where
    'ANumber_Prefix' != "23" or 'ANumber_Prefix' != "28" or
    'ANumber_Prefix' != "77" or 'ANumber_Prefix' != "75" or
    'ANumber_Prefix' != "70" or 'ANumber_Prefix' != "71"


  • 4.  RE: Using NOT EQUAL (!=) to exclude specific figures from set of data

    Employee
    Posted 11-17-2013 17:39

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: Tim Meagher

    The problem is in the "or" logic.
    There will never be anything which won't match that criteria.

    Just looking at the first piece of the or statement:
    'ANumber_Prefix' != "23" or 'ANumber_Prefix' != "28"


    Consider the case of an ANumber_Prefix of "23", then this will effectively evaluate to:
    "23" != 23 or "23 != "28"


    Which in turn evaluates to:
    false or true
    Which evaluates to true.
    For an ANumber_Prefix of 20, then this would evaluate to:
    "20" != 23 or "23 != "28"


    Which in turn evaluates to:
    true or true
    Which evaluates to true.

    Do you want to use "and" in place of "or"?
    Which would mean that the data would only be output where the ANumber_Prefix is not any of: 23, 28, 77, 75 or 71?

    Tim