concat(x;d)

Description:

Use a delimiter to concatenate values of an aggregation field.

Syntax:

concat(x;d)

Note:

The function concatenates values of aggregation field x using the delimiter d; concatenate them without using a delimiter when parameter d is absent. It can only work as the aggregate function in the groups() function.

Parameter:

x

Aggregation field name

d

A delimiter

Option:

@c

Concatenate with the comma

@i

Enclose each to-be-concatenated value with the single quotation marks

@q

Enclose each to-be-concatenated value with the double quotation marks; won’t quote them when the option is absent

Return value:

String

Example:

 

A

 

1

=demo.query("select EID,NAME,DEPT from employee")

Return a table sequence.

2

=A1.groups(DEPT;concat(NAME;"_"):ALL_NAME)

Group A1’s table sequence by DEPT field, concatenate NAME values in each group with the delimiter _ and return them to ALL_NAME column.

3

=A1.groups(DEPT;concat@c(NAME):ALL_NAME)

Work with @c option to use the comma as the delimiter.

4

=A1.groups(DEPT;concat@q(NAME):ALL_NAME)

Work with @q option to enclose each to-be-concatenated value with the double quotation marks.

5

=A1.groups(DEPT;concat@i(NAME):ALL_NAME)

Work with @i option to enclose each to-be-concatenated value with the single quotation marks.

6

=A1.groups(DEPT;concat@i(NAME;"|"):ALL_NAME)

Work with @i option to enclose each to-be-concatenated value with the single quotation marks, and use | as the delimiter.