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.  How to filter a node similar to SQL WHERE NAME IN ('ERICA', 'JOHN', 'DOUG', 'ERIC')

    Employee
    Posted 09-10-2015 09:11

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

    Originally posted by: egiesen

    I would like to filter a node similar to a sql command
    where NAME IN ('ERICA', 'JOHN', 'DOUG', 'ERIC')

    I realize I could do it with a OR clause
    where NAME = 'ERICA'
    or NAME = 'ERIC'
    or

    But that seems so redundant. Im hoping there is something like a IN clause??

    Thanks


  • 2.  RE: How to filter a node similar to SQL WHERE NAME IN ('ERICA', 'JOHN', 'DOUG', 'ERIC')

    Employee
    Posted 09-10-2015 10:00

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

    Originally posted by: stonysmith

    Two ways to do this...

    where strFindI("|ERICA|JOHN|DOUG|ERIC|", "|"+NAME+"|") > -1

    - using the separator keeps you from matching the name "RIC" to either of Erica or Eric
    - in this case you need to pick a separator that can't exist in your data.

    or:
    where find(list("ERICA", "JOHN", "DOUG", "ERIC") , NAME) > -1

    using FIND(LIST()) is a little less efficient than the STRFIND function but it's more readable.