BusinessObjects Board

Information Steward Rule - Find Substring in String

My requirement is simple and I am shocked Information Steward does not seem to support this functionality.

Essentially I am trying to determine if a string contains a substring, and if it does, I want to flag this as an error.

So for instance, the whole string I am checking is ‘abcdefg’. If this string contains the substring ‘cd’ then I want to flag this as an error.

I have tried to use the match regular expression function but it does not work. Does anyone have any insight?


dsewardj (BOB member since 2012-10-22)

Has anybody found a solution to this “easy” requirement yet?

I cannot find a way to find a substring defined in a variable within a given input.
i.e:

$searchstring - variable of type varchar where substring is located
$input - Input string which should be checked wheter it contains the variable $searchstring.

Any help would be greatly appreciated


riegjul (BOB member since 2018-05-24)

I imagine theres half a dozen different ways to do this, including using regular expressions. I typically use the index() function. It returns the starting position of the substring field if present. (check if index > 0)

of note… if you’re trying to raise an exception, DS doesnt seem to like having the raise_exception inside of an ifthenelse statement. I believe the optimizer must garbage collect the field and you get nothing on output. So my suggestion is to wrap a custom function around it.


jlynn73 :us: (BOB member since 2009-10-27)