Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Custom Filter In Database ( starts with, ends with, contains)

tclopes
5 - Atom

I am trying to create multiple filters using  a combination of " starts with" , "ends with", "contains" , " does not contain" and etc... 

 

Does anyone know how to to create a custom filter in SQL using these formulas?

1 REPLY 1
MattBSlalom
11 - Bolide

The available SQL functions can vary based on the database platform you're querying.  With that said, some of the most commonly available functions are below:

  1. LEFT - get the first n characters from a string.  example:  LEFT(Field_ABC, 3) = 'abc'
  2. RIGHT - get the last n characters from a string.  example: RIGHT(Field_ABC, 3) = 'xyz'
  3. LIKE - compare a string to a given pattern, usually with percent character (%) as wildcard.

LIKE example for "starts with":  Field_ABC LIKE 'abc%'

LIKE example for "ends with":  Field_ABC LIKE '%xyz'

LIKE example for "contains":  Field_ABC LIKE '%mn%'

LIKE example for "does not contain":  Field_ABC NOT LIKE '%123%'

Polls
We’re dying to get your help in determining what the new profile picture frame should be this Halloween. Cast your vote and help us haunt the Community with the best spooky character.
Don’t ghost us—pick your favorite now!
Labels