Quantcast
Channel: SCN : Document List - Data Services and Data Quality
Viewing all articles
Browse latest Browse all 401

Using match_regex function to replace "LIKE" function in Information Steward Rules

$
0
0

I came across a requirement in Information Steward, to create a Rule that looks for the word "Competitor" in the column string, The name of the columns was NOTES (lets just say).

 

This word"Competitor" can be at any location in the string and can be in case. If this word exists, then the rule should pass the value else fails it.

 

The equivalent SQL Query for this would be simple:

 

WHERE

UPPER(NOTES) LIKE '%COMPETITOR%'

 

But to do the same in the Rule, we do not have the LIKE function.

 

Instead, we had to use the following formula (using match_regex function) to perform the same task.

 

BEGIN

RETURN

match_regex($parameter0, '.*COMPETITOR.*', 'CASE_INSENSITIVE');

END

 

This will do the trick.

 

Thanks,

Shaheen Makandar


Viewing all articles
Browse latest Browse all 401

Latest Images

Trending Articles





Latest Images