Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

array_agg postgresql in AC

Avatar

Avatar
Ignite 1
Level 2
szymons55769873
Level 2

Likes

5 likes

Total Posts

22 posts

Correct Reply

0 solutions
Top badges earned
Ignite 1
Validate 1
Give Back
Boost 5
Boost 3
View profile

Avatar
Ignite 1
Level 2
szymons55769873
Level 2

Likes

5 likes

Total Posts

22 posts

Correct Reply

0 solutions
Top badges earned
Ignite 1
Validate 1
Give Back
Boost 5
Boost 3
View profile
szymons55769873
Level 2

22-10-2019

Hello

Is it possible to group (concat) certain string values in one column by common value in other column in AC Classic? I've tried with Group By but it's for numerical aggregates and there's a function in postgresql which does that (array_agg) and wondering if it's possible somehow to emulate it with activities? (Having in mind that with SQL Activity it's not possible to make outbound transition with select results)

Eg.

City             |  Country

------------------------------

Madrid          Spain

Barcelona     Spain

Paris               France

Nice               France

Output would be:

Madrid, Barcelona     Spain

Paris, Nice                  France

Kind regards

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Establish
MVP
wodnicki
MVP

Likes

976 likes

Total Posts

1,096 posts

Correct Reply

514 solutions
Top badges earned
Establish
Affirm 500
Contributor
Shape 1
Give Back 100
View profile

Avatar
Establish
MVP
wodnicki
MVP

Likes

976 likes

Total Posts

1,096 posts

Correct Reply

514 solutions
Top badges earned
Establish
Affirm 500
Contributor
Shape 1
Give Back 100
View profile
wodnicki
MVP

22-10-2019

Hi,

You can probably do this with queryDef, defining the groupBy independently of the <select/> and enabling unknown sql functions/adding array_agg function. If not it's just a couple lines extra to spool the results into a map then update the temp schema with '{' + map[k].join(',') + '}'.

Thanks,

-Jon

Answers (0)