Five Stars

How to pivot rows and columns?

Hello.

 

I have a file with this schema:

 

Type                       PlaceA      PlaceB      PlaceC     PlaceD     PlaceE

Value per hour         1.56            2.76          1.64         1.75          3.54

Value per month      3.66            1.54          5.47         0.75          10.2

Value per year          0.13            7.31          0.12         8.11          1.21

 

I want to store values in a schema like this:

Place    Value per hour    Value per month  Value per year

PlaceA         1.56                     3.66                   0.13

PlaceB         2.76                     1.54                   7.31

PlaceC         1.64                     5.47                   0.12

PlaceD         1.75                     0.75                   8.11

PlaceE          3.54                     10.2                   1.21

 

How can I do this? I only want to pivot the entire data.

 

Thanks in Advance.

Kind Regards.

4 REPLIES
Four Stars

Re: How to pivot rows and columns?

Hi,

 

Use tPivotToColumnsDelimited component

 

Moderator

Re: How to pivot rows and columns?

Hello,

Could you please have a look at this article:https://community.talend.com/t5/Migration-Configuration-and/Converting-rows-to-columns/ta-p/21667 to see if it is what you are looking for?

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Five Stars

Re: How to pivot rows and columns?

Hello, I solved it using tjava component writing some handcode and tmap component.

It's done.

 

Thanks!

Moderator

Re: How to pivot rows and columns?

Hello,

Here is a custom component tTranspose written by talend community user and shared on talend exchange portal which can move rows to columns / columns to rows.

https://exchange.talend.com/#marketplaceproductoverview:marketplace=marketplace%252F1&p=marketplace%...

Let us know if it works for you.

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.