0

Multiple string exclusion from table

Hello, I am trying to exclude specific string from my table but I am having issues excluding everything I want. Tried selecting and using logic to add them in but it is not working. It works for when I just want to exclude one specific string but when I start adding more to look for and exclude it breaks. 

Code rn is: SELECT (@A:A, AND (NOT (CONTAINS (@A:A, "/l/874091"))))

but I want to filter values that contain "preview" "test" "Preference-Center" and "unsubscribe"

3 comments

  • 0
    Avatar
    Shane Postma

    Basically I want SELECT (@A:A, AND (NOT (CONTAINS (@A:A, "/l/874091", "preview", "test", "Preference-Center", "unsubscribe")))) but I want it to work 

  • 1
    Avatar
    Claire Jones

    Hi Shane, 

    Thanks for the post!

    For your function to exclude each of the strings, you would have to use the OR function and a CONTAINS function for each term.

    OR ( CONTAINS( haystack , needle1 ) , CONTAINS( haystack , needle 2) )

    Which in your case would look like this:

    SELECT (@A:A, NOT (OR (CONTAINS (@A:A, "/l/874091"), CONTAINS (@A:A, "preview"), CONTAINS (@A:A, "test"), CONTAINS(@A:A, "Preference-Center"), CONTAINS(@A:A,"unsubscribe")))) 

    I hope this helps! If you have any questions around this, feel free to log a ticket with our support team at support@klipfolio.com

  • 0
    Avatar
    Shane Postma

    Verified! Thank you (:

Please sign in to leave a comment.