join
join(T.A : text; S : text) sort T.B : ‘a 🡒 text, aggregator
The aggregator requires a sort
option to be specified and returns the resulting concatenation of the text values.
Example:
table T = with
[| as A, as B |]
[| "hello", "a" |]
[| "hello", "a" |]
[| "hello", "b" |]
[| "world", "b" |]
[| "world", "c" |]
table G[gdim] = by T.B
G.S = ";"
where T.B != "c"
show table "" a1b4 with
gdim
join(T.A; G.S) sort T.A
group by gdim
The sort
option can be applied to any ordered data type.
Beware, text values are limited to 256 characters in Envision.
It would also be possible to re-implement join
with a user-defined process:
def process myJoin(a : text; delimiter : text) with
keep c = ""
where c == ""
c = a
else
c = "\{c}\{delimiter}\{a}"
return c