Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
JohnBog2023
Contributor
Contributor

Transposed with multiple agregation column

HI, I have the next table information like input:

0695b00000ddkv4AAA.png

And I need to generate the following result

0695b00000ddlckAAA.png

I tried tried with tPivotToColumnsDelimited

, but only allows one agregation columns.

Any idea?

Labels (2)
3 Replies
Anonymous
Not applicable

Hello,

Could you please take a look at this KB article about:

https://community.talend.com/s/article/Converting-rows-to-columns-Jewx3

Feel free to let us know if it is what you are looking for.

Best regards

Sabrina

JohnBog2023
Contributor
Contributor
Author

Hi xdshi, thanks for your answer, but i looking for manage multiple ​agregation columns, in the example "total groups" and "total students". ​ The tPivotToColumnsDelimited only have one agregation column. In the example i put 2 , but in the real case i have more than 10 variables.

michael254
Contributor
Contributor

Hello,

I would like to suggest you here

It looks like you are trying to perform a pivot operation on the given table to obtain the desired output. However, since you want to aggregate multiple columns, the tPivotToColumnsDelimited component may not be sufficient.

You can use the tPivotToColumns component instead, which allows you to specify multiple aggregation columns. Here's how you can do it:

  1. Connect your input table to the tPivotToColumns component.
  2. In the "Group By" section, select the "id" column and all the columns that you want to use as row headers (i.e., "date" and "category").
  3. In the "Aggregations" section, add the "value" column and select "sum" as the aggregation function. Then, add the "value2" column and select "max" as the aggregation function.
  4. In the "Advanced Settings" section, select "Generate key column" and specify a name for the key column (e.g., "key").
  5. Click on "Preview" to verify that the output is as expected.
  6. If the output is correct, you can connect the tPivotToColumns component to your output destination.

The resulting output should be similar to the one you provided.

I hope this helps! www.mywafflehouse.com