Concat - script function
Last updated: 9/29/2026
Concat() is used to combine string values. The script function returns the aggregated string concatenation of all values of the expression iterated over a number of records as defined by a group by clause.
Syntax:
Return data type: string
Arguments:
The expression or field containing the string to be processed.
| Argument | Description |
|---|---|
| string |
The expression or field containing the string to be processed. |
| delimiter | Each value may be separated by the string found in delimiter. |
| sort_weight |
The order of concatenation may be determined by the value of the dimension sort_weight, if present, with the string corresponding to the lowest value appearing first in the concatenation. When 0 is used as the sort_weight argument value, sorting is not applied to the output. If the sort_weight argument is omitted, the function defaults to alphanumeric sorting. |
| distinct | If the word distinct occurs before the expression, all duplicates are disregarded. |
Examples and results:
Add the example script to your document and run it. Then add, at least, the fields listed in the results column to a sheet in your document to see the result.
| Example | Result field | Result value |
|---|---|---|
|
TeamData: LOAD * inline [ SalesGroup|Team|Date|Amount East|Gamma|01/05/2013|20000 East|Gamma|02/05/2013|20000 West|Zeta|01/06/2013|19000 East|Alpha|01/07/2013|25000 East|Delta|01/08/2013|14000 West|Epsilon|01/09/2013|17000 West|Eta|01/10/2013|14000 East|Beta|01/11/2013|20000 West|Theta|01/12/2013|23000 ] (delimiter is '|');
Concat1: LOAD SalesGroup,Concat(Team) as TeamConcat1 Resident TeamData Group By SalesGroup; |
SalesGroup East West |
TeamConcat1 AlphaBetaDeltaGammaGamma EpsilonEtaThetaZeta |
|
Given that the TeamData table is loaded as in the previous example: LOAD SalesGroup,Concat(distinct Team,'-') as TeamConcat2 Resident TeamData Group By SalesGroup; |
SalesGroup East West |
TeamConcat2 Alpha-Beta-Delta-Gamma Epsilon-Eta-Theta-Zeta |
|
Given that the TeamData table is loaded as in the previous example. Because the argument for sort_weight is added, the results are ordered by the value of the dimensionAmount: LOAD SalesGroup,Concat(distinct Team,'-',Amount) as TeamConcat2 Resident TeamData Group By SalesGroup; |
SalesGroup East West |
TeamConcat2 Delta-Beta-Gamma-Alpha Eta-Epsilon-Zeta-Theta |
|
T1:
Load *
INLINE [
EmployeeID, Unit, Department, Age, Salary, Country
1, A, z, 30, 81000, GER
2, B, z, 29, 39000, IRL
3, B, y, 40, 58000, IRL
4, A, y, 45, 71000, USA
5, A, z, 26, 79000, GBR
6, B, z, 20, 31000, GER
7, A, y, 56, 29000, USA
8, A, y, 35, 52000, GBR
];
T2:
Load
Unit,
Concat(Age, '-', 0) as ConcatNoSort
resident T1 group by Unit;
|
Unit A B |
ConcatNoSort 30-45-26-56-35 29-40-20 |