Replicate LIKE condition

(Amey Gupte) #1

I want to replicate the ‘LIKE’ condition in SQL in an expression in DQC. Is there a way to do it? Would 'VARIABLE = ‘%STRING%’ work as LIKE?

(Victoria Tuktarova) #2

Hi Amey,

I would suggest using ‘matches’ expression to verify whether the string matches the pattern. The syntax should look like this

matches ( string srcRegex , string srcStr [, boolean caseInsensitive{{=false}}])

You can find details in the Help section.

For instance:

matches(".*01", column_name)

, where (.*) matches any char zero or more times.

Kind regards,

(Srinivas Komajravolu) #3


string multiplication expression using “containsWord” is another way if you don’t have regrex expressions.

containsWord( string srcStr , string srcWord, string separator =" "])