Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Table Transformer - concatenate data from multiple rows based on criteria

Joel Tabares September 24, 2020

Hi,

SQL functions in Table Transformer is limited that i'm having trouble concatenating/merging data from multiple rows.

 

Table

Project  | Remarks

P1   |  The quick brown

P1   |  Fox jumps

P2   |  Over the

P2   |  Lazy dog

 

I need it to produce the output below:

Project | Remarks

P1   | The quick brown Fox jumps

P2   | Over the Lazy dog

 

2 answers

1 accepted

2 votes
Answer accepted
Katerina Kovriga {Stiltsoft}
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 25, 2020

Hi @Joel Tabares ,

It seems that's a duplicate question for this one.

Let me repeat the answer here:

There are two options to resolve your case: the Table Transformer macro and the Pivot Table macro.

1.png

Option 1. Table Transformer

Use the following custom SQL query: SELECT T1.'Project', SUM(T1.'Remarks' + " ") AS 'Remarks' FROM T1 GROUP BY T1.'Project'

2.png3.png

Option 2. Pivot Table

Recreate the settings from the screenshots below:

4.png5.png

Sofia Kargioti _QC Analytics_ October 1, 2020

Thanks @Katerina Kovriga {Stiltsoft}  it worked for me

0 votes
Bastian Stehmann
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 24, 2020

Hi Joel,

 

if you could add an ID to your source table, like this

 

ID | Project | Remarks

1   | P1   |  The quick brown

2   | P1   |  Fox jumps

3   | P2   |  Over the

4   | P2   |  Lazy dog

It works with this sql.

SELECT concat (a.'Remarks'," ", b.'Remarks') FROM T1 a, T1 b where a.'Project'=b.'Project' and a.'ID'<b.'ID'

 

Usually I would use the rownum instead of the ID in SQL, but that didn't work for me in the table transformer.

Andrey Khaneev _StiltSoft_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 25, 2020

Hi @Bastian Stehmann ,

ROWNUM() function returns the current row number. You can try to use it instead of the ID column.

Like # people like this
Bastian Stehmann
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 25, 2020

Ah, great, thank you very much.

Joel Tabares September 25, 2020

Thank you all. Yes it was a duplicate question. I accidentally created the first one under the product Jira and couldn't delete it so i created the same question under Confluence.  I have what i need now. Thanks again!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events