I'm setting up some relations to extract portions of a master parameter into other parameters.
So far, everything went as expected. Until I got to the end of the string. The last bit of the master parameter may vary between one and 5 characters. If I enter the length bit of the extract relation as 5, it doesn't like when the master parameter has fewer than 5 characters.
Is there a way to get around this issue?
Solved! Go to Solution.
If I am reading your question right you are running into an issue in which the extract function is trying to extract more characters than exist in some cases. This returns a null which causes the relation to fail.
The way to get around this is to check the length of the string prior to executing the extract function.
parameter = extract(extract_parameter,1,5)
Use the string_length() function to determine how many characters to extract.
I did think about trying to use string length. With that last portion being between 1 and 5 characters (at the end of 22 other characters) I was hoping there was a more elegant solution than nesting a bunch of "IF STRING_LENGTH" statements together.
Something that would tell the system to just extract all characters past the 22nd one, regardless of how many exist.