Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

JOIN

This function joins a series of values into one string, separated with a character of your choice.

Syntax

Panel
bgColorwhite

CONCATENATE


Use the '+' (plus) operator to concatenate strings or a combination of strings and other type values to produce a single string value.


Syntax

Code Block
string1 + string2 + ... + value1 + ...



Inputs
  • string1 - The first string that you want to concatenate.
  • string2 - The second string that you want to concatenate.
  • value1 - A value of some type of number, date or boolean that you want to add to the new string value.


Return type

  • string


Examples

ExpressionResultType
12 + " kilometers""12 kilometers"String
"This statement is " + TRUE + ".""This statement is true."String
"I was born on " + Me.birthDateAndTime + ".""I was born on Tue Dec 01 23:00:45 CET 1970."String
( UPPERCASE "hello" ) + ( LOWERCASE " WORLD" )"HELLO world"String
UPPERCASE( "hello" ) + LOWERCASE( " WORLD" )"HELLO WORLD"String

Suppose

Person.FirstName = "Carl"

Person.LastName = 

then Person.FirstName + Person.LastName

? (UNKNOWN)String
UI Text Box
typewarning

Note the correct use of parenthesis in combination with concatenation, see UPPERCASE and LOWERCASE syntax.



UI Text Box
typeinfo

There exists a STR_CONCAT ( string , string ) function in the expression language. As it can only concatenate two strings, and is much longer in typing, we advise to use above way for concatenating strings.

Back to top

Panel
bgColorwhite
Code Block
JOIN ( argument1 , argument2 , ... , separator )
Inputs
  • argument1, argument2 - Attributes or expressions that contain the values that will be joint to a single string. JOIN works for all base types, even multivalued.
  • separator - A string value that will be used as separator symbol.

Return type

  • string
UI Text Box
typenote
an UNKNOWN value will be represented as an empty entry in the result string.
UI Text Box
typenote

The CONCAT function is identical to the JOIN function, except for handling of UNKNOWN.

Examples

Suppose you have a model containing the following attributes.

AttributeBasetypeValuePerson.namestring"John"Person.date_of_birthdate01-01-1995Person.family_namestringExpressionResultTypeJOIN ( Person.name , Person.date_of_birth , ";" )"John;Sun Jan 01 00:00:00 CET 1995"StringJOIN ( Person.name , Person.name , "@" )"John@John"StringJOIN ( Person.name , Person.family_name , YEARS BETWEEN Person.date_of_birth AND DATE ( 2015 , 01 , 01 ) , ";" )"John;;20"String

Back to top

Panel
bgColorwhite

MATCH

The MATCH function compares a string pattern to another string and returns TRUE if the string exactly matches the pattern, and otherwise FALSE. The MATCH function is case-sensitive.

Syntax

Code Block
MATCH ( pattern , string )

Inputs

  • pattern - An attribute of base type string or a string value. String must be a valid regular expression. The regular expressions used in several Blueriq Studio functions are common Java 1.4 expressions. For a complete documentation we refer to the online java documentation.
  • string - String value, attribute of base type string or an expression that results in a string value.

Return type

  • Boolean

Examples

Entity.attributeValueTypeFile.name"Thisfile_1.doc"StringExpressionResultTypeMATCH ( "Thisfile_1.doc" , File.name )TRUEBooleanMATCH ( File.name , "Thisfile_1.doc" )TRUEBooleanMATCH ( " Thisfile_1.doc" , File.name )FALSEBooleanMATCH ( "thisfile_1.doc" , File.name )FALSEBooleanMATCH ( "[A-Z]hisfile_1.doc" , File.name )TRUEBooleanMATCH ( "[a-z]hisfile_1.doc" , File.name )FALSEBooleanMATCH ( "Thisfile_[0-9].doc" , File.name )TRUEBooleanMATCH ( ".............." , File.name )TRUEBooleanMATCH ( ".*" , File.name )TRUEBooleanMATCH ( "**" , "**" )Error"**" is not a valid regular expression

Back to top

Panel
bgColorwhite

FIND

The FIND function looks for a string pattern within another string and returns the first matching characters. The function is case-sensitive.

Syntax

Code Block
FIND ( pattern , string )
FIND ( pattern , string , startIndex )
Inputs
  • pattern - An attribute of base type string or a string value. String must be a valid regular expression. The regular expressions used in several Blueriq Studio functions are common Java 1.4 expressions. For a complete documentation we refer to the online java documentation.
  • string - An attribute of base type string or an expression that results in a string.
  • startIndex - A positive integer value indicating at which character of the string the search should start (inclusive). This can be either an attribute of base type integer, an expression that results in an integer or a constant integer value. The first character starts at index 0.

Return type

  • string

Examples

Entity.attributeValueTypeFile.name"Thisfile_1.doc"StringExpressionResultTypeFIND ( "_[1-5]" , File.name )"_1"StringFIND ( "File" , File.name )UNKNOWNStringFIND ( "el" , "Hello" )"el"StringFIND ( "el" , "Hello" , 2 )UNKNOWNStringFIND ( "eo" , "Hello" )UNKNOWNStringFIND ( "\s[a-zA-Z]+" , "Hello world example" )"world"StringFIND ( "\s[a-zA-Z]+" , "Hello world example" , 6 )"example"String

Back to top

Panel
bgColorwhite

FIRST

FIRST returns the first character(s) of a string, based on the number of characters you specify.

Syntax

Code Block
FIRST integer CHARACTERS OF string
FIRST CHARACTER OF string
Inputs
  • integer - A positive integer value. This can be either an attribute of base type integer, an expression that results in an integer or a constant integer value. FIRST CHARACTER OF can be used to retrieve only the first character of the string.
  • string - An attribute of base type string, an expression that results in a string or a constant string value.

Return type

  • string
UI Text Box
typenote

If you prefer a functional syntax, you can use the STR_FRONT( string, integer ) function. Example: STR_FRONT("Blueriq", 3) = "Blu"

Examples

Entity.attributeValueTypeFile.name"Thisfile_1.doc"StringFile.prefix8IntegerExpressionAlternative syntaxResultTypeFIRST File.prefix CHARACTERS OF File.nameSTR_FRONT( File.name , File.prefix )ThisfileStringFIRST CHARACTER OF File.nameSTR_FRONT( File.name , 1 )TStringFIRST 5 CHARACTERS OF "pieceofcake"STR_FRONT( "pieceofcake" , 5 )pieceString

Back to top

Panel
bgColorwhite

LAST

LAST returns the last character(s) of a string, based on the number of characters you specify.

Syntax

Code Block
LAST integer CHARACTERS OF string
LAST CHARACTER OF string

Inputs

  • integer - A positive integer value. This can be either an attribute of base type integer, an expression that results in an integer or a constant integer value. LAST CHARACTER OF can be used to retrieve only the last character of the string.
  • string - An attribute of base type string, an expression that results in a string or a constant string value.

Return type

  • string
UI Text Box
typenote

If you prefer a functional syntax, you can use the STR_BACK ( string, integer ) function. Example: STR_BACK("Blueriq", 3) = "riq"

Examples

Entity.attributeValueTypeFile.name"Thisfile_1.doc"StringFile.extension3IntegerExpressionAlternative syntaxResultTypeLAST File.extension CHARACTERS OF File.nameSTR_BACK( File.name , File.extension )"doc"StringLAST CHARACTER OF File.nameSTR_BACK( File.name , 1 )"c"StringLAST 4 CHARACTERS OF "pieceofcake"STR_BACK( "pieceofcake" , 4 )"cake"String

Back to top

...

bgColorwhite

LENGTH

LENGTH returns the length of a string. 

Syntax

Code Block
LENGTH ( string )

Inputs

  • string - An attribute of base type string, an expression that results in a string or a constant string value.

Return type

  • integer
UI Text Box
typenote

Spaces at the start of the end of the string are counted as well, the string is not trimmed.

Example

...

Back to top

...

bgColorwhite

UPPERCASE

UPPERCASE returns a string with all characters in uppercase. 

Syntax

Code Block
UPPERCASE string

...

  • string - An attribute of base type string, an expression that results in a string or a constant string value.
UI Text Box
typewarning

UPPERCASE does not have a functional syntax. This can have unexpected effects on concatenation. UPPERCASE ( "hello" ) + LOWERCASE ( " WORLD" ) is equivalent to UPPERCASE ( ( "hello" ) + LOWERCASE ( " WORLD" ) ). Use ( UPPERCASE string ) syntax to avoid this behaviour.

Return type

  • string

Example

...

Back to top

...

bgColorwhite

LOWERCASE

LOWERCASE returns a string with all characters in lowercase. 

Syntax

Code Block
LOWERCASE string

...

  • string - An attribute of base type string, an expression that results in a string or a constant string value.
UI Text Box
typewarning

LOWERCASE does not have a functional syntax. This can have unexpected effects on concatenation. LOWERCASE ( "HELLO" ) + UPPERCASE ( " world" ) is equivalent to LOWERCASE ( ( "HELLO" ) + UPPERCASE ( " world" ) ). Use ( LOWERCASE string ) syntax to avoid this behaviour.

Return type

  • string

Example

...

Back to top

...

bgColorwhite

CAPITALIZE

CAPITALIZE returns a string with the first character uppercased. 

Syntax

Code Block
CAPITALIZE string
CAPITALIZE ( string, lowerTheRest )

Inputs

  • string - An attribute of base type string, an expression that results in a string or a constant string value.
  • lowerTheRest - An attribute of base type boolean, an expression that results in a boolean or a constant boolean value, indicating that the other characters need to be lowercased. This parameter is optional and if it is not supplied, the other characters are left untouched.

Return type

  • string

Example

...

Back to top

...

bgColorwhite

TRIM

TRIM strips the leading and trailing spaces from a string 

Syntax

Code Block
TRIM string

Input

  • string - An attribute of base type string, an expression that results in a string or a constant string value.

Return type

  • string

Example

...

Back to top

...

bgColorwhite

INDEXOF

INDEXOF returns the index of the first occurrence of a specified substring in a string.

Syntax

Code Block
INDEXOF ( string , substring )
INDEXOF ( string , substring , startIndex )

Inputs

  • string - An attribute of base type string, an expression that results in a string or a constant string value.
  • substring - An attribute of base type string, an expression that results in a string or a constant string value.
  • startIndex - A (positive) integer value indicating at which character the search for the substring should start (inclusive). This can be either an attribute of base type integer, an expression that results in an integer or a constant integer value.
    The first character starts at index 0.

Return type

  • integer - the index of the first occurrence of the specified substring or -1 if it is not found

Example

...

UI Text Box
typenote
There is no restriction on the value of startIndex. If it is negative, it has the same effect as if it were zero: this entire string may be searched. If it is greater than the length of this string, it has the same effect as if it were equal to the length of this string: -1 is returned.

Back to top

...

bgColorwhite

LASTINDEXOF

LASTINDEXOF returns the index of the last occurrence of a specified substring in a string. 

Syntax

Code Block
LASTINDEXOF ( string , substring )
LASTINDEXOF ( string , substring , startIndex )

Inputs

  • string - An attribute of base type string, an expression that results in a string or a constant string value.
  • substring - An attribute of base type string, an expression that results in a string or a constant string value.
  • startIndex - A (positive) integer value indicating at which character the search for the substring should start (inclusive), searching backwards. This can be either an attribute of base type integer, an expression that results in an integer or a constant integer value.

Return type

  • integer - the index of the last occurrence of the specified substring or -1 if it is not found

Example

...

UI Text Box
typenote
There is no restriction on the value of startIndex. If it is negative, it has the same effect as if it were zero: -1 is returned since there are no characters before character 0. If startIndex is greater than the length of this string, it has the same effect as if it were equal to the length of this string, so the whole string is searched.

Back to top

...

bgColorwhite

SUBSTRING

SUBSTRING returns the substring of a given string starting from the index provided and ending at the end index if provided, or the end of the string. 

Syntax

Code Block
SUBSTRING ( string , startIndex )
SUBSTRING ( string , startIndex , endIndex )

Inputs

  • string - An attribute of base type string, an expression that results in a string or a constant string value.
  • startIndex - A positive integer value indicating at which character the substring should start (inclusive). This can be either an attribute of base type integer, an expression that results in an integer or a constant integer value. The first character starts at index 0.
  • endIndex - A positive integer value indicating at which character the substring should end (exclusive). This can be either an attribute of base type integer, an expression that results in an integer or a constant integer value. The endIndex cannot exceed the length of the string and should be larger than the startIndex.

Return type

  • string

Example

...

Back to top

...

bgColorwhite

SUBSTRING BEFORE

SUBSTRING_BEFORE returns the start of a given string before the first occurrence of substring, or an empty string if substring is not found

Syntax

Code Block
SUBSTRING BEFORE substring IN string
SUBSTRING_BEFORE ( string , substring )

Inputs

  • string - An attribute of base type string, an expression that results in a string or a constant string value.
  • substring - An attribute of base type string, an expression that results in a string or a constant string value.

Return type

  • string

Example

...

SUBSTRING_BEFORE ( "hello:world:all" , ":" )

...

Back to top

...

bgColorwhite

SUBSTRING AFTER

SUBSTRING_AFTER returns the end of a given string after the first occurrence of substring, or an empty string if substring is not found. 

Syntax

Code Block
SUBSTRING AFTER substring IN string
SUBSTRING_AFTER ( string , substring )

Inputs

  • string - An attribute of base type string, an expression that results in a string or a constant string value.
  • substring - An attribute of base type string, an expression that results in a string or a constant string value.

Return type

  • string

Example

...

Back to top

...

bgColorwhite

SPLIT

SPLIT returns a multivalued attribute containing every substring that is delimited by the given pattern. 

Syntax

Code Block
SPLIT string ON pattern
SPLIT ( string , pattern )

Inputs

  • string - An attribute of base type string, an expression that results in a string or a constant string value.
  • pattern - An attribute of base type string or a string value. String must be a valid regular expression. The regular expressions used in several Blueriq Studio functions are common Java 1.4 expressions. For a complete documentation we refer to the online java documentation.

Return type

  • string (multivalued)

Example

...

UI Text Box
typenote

If you use the SPLIT in a default expression on an multivalued attribute, please note that the result will be stored as collection, meaning that all duplicates will be removed. To illustrate this: suppose we have an attribute Test.Splitted (multivalued), which has the default expression SPLIT ( "H.E.L.L.O" , "\."). The result of the expression JOIN ( Test.Splitted , "" ) = "HELO" instead of "HELLO" as in the last example.

Back to top

...

bgColorwhite

REPLACE

The REPLACE function replaces every occurrence of a string pattern within another string with a provided replacement string. The function is case-sensitive.

Syntax

Code Block
REPLACE pattern IN string WITH replacement
REPLACE ( pattern , string , replacement )

...

  • pattern - An attribute of base type string or a string value. String must be a valid regular expression. The regular expressions used in several Blueriq Studio functions are common Java 1.4 expressions. For a complete documentation we refer to the online java documentation.
  • string - An attribute of base type string or an expression that results in a string.
  • replacement - An attribute of base type string or an expression that results in a string.

Return type

  • string. If the pattern is not found, the original string is returned.

Examples

...

UI Text Box
typenote
The first argument is a pattern (regular expression) and can therefore contain specials like \s for a space. The second and third arguments are strings or expressions, so \s will result in \s.

Back to top

...

bgColorwhite

EQUALS

EQUALS compares two strings and returns TRUE if and only if they are equal. This function is case sensitive.

UI Text Box
typewarning

Only use this function if you need a case sensitive comparison of two strings. If you want to compare strings case insensitive, use the '=' operator instead.

Syntax

Code Block
string1 EQUALS string2
EQUALS ( string1 , string2 )

Inputs

  • string1 - An attribute of base type string, an expression that results in a string or a constant string value.
  • string2 - An attribute of base type string, an expression that results in a string or a constant string value.

Return type

  • Boolean

Example

...

Back to top