splice(X;Y)

Returns a string consisting of the list of given values concatenated together using the specified separator.

Syntax

splice(X;Y)

Input

Argument Type Description
X any A list of values (or column names containing values) to be concatenated
Y text One or more characters to be used as the separator

Return Value

Returns the text string consisting of the concatenated list of values in X using the separator specified by Y. This function provides a way of combining several columns to form one column.

Note: Numeric values are automatically converted to text.

N/A values are treated like empty strings and are concatenated with the other values and the separator.

Sample Usage

values sep splice(values;sep)
'time is' '10' '30' ':' 'time is:10:30'

Example

In the "Product Master" table (pub.demo.retail.prod), let's say we wanted to create a computed column that consisted of the department description (deptdesc), the department number (dept), and the division description (divdesc) separated by dashes ("-"). We could do this by using the splice(X;Y) function and specifying the three column names in the list for the X parameter and the dash for the Y parameter.

<base table="pub.demo.retail.prod"/>
<willbe name="splice_result" label="Department-Number-Division" 
 value="splice(deptdesc dept divdesc;'-')"/>
<colord cols="splice_result"/>

This would give us the following results: