Skip to main content
Question

Transpose (rotate) data from rows to columns


Forum|alt.badge.img

I'm reading a source file and this is the output.

What I would like to have instead is only one row per Name and then have one column for each number of months (as attribute name) and its RRP (as attribute value).

The columns should be the following:

header/attributes:

Name ; 3-Months-RRP ; 6-Months-RRP ; 9-Months-RRP ; 12-Months-RRP

values:

AR201130 ; 5.82; 11.64 ; 17.46 ; 19.40

Thanks for your help.

3 replies

erik_jan
Contributor
Forum|alt.badge.img+17
  • Contributor
  • April 23, 2018

I believe the AttributePivoter transformer should be able to do this.


danilo_fme
Evangelist
Forum|alt.badge.img+41
  • Evangelist
  • April 23, 2018

Hi @kat

Did you try to use the custom transformer AttributeTransposer?

Thanks,

Danilo


takashi
Contributor
Forum|alt.badge.img+19
  • Contributor
  • April 23, 2018

Hi @kat, I often use a combination of BulkAttributeRenamer and Aggregator for this kind of task. The AttributeCreator can alto be used to create a new attribute named "@Value(NumberOfMonths)-Months-RRP" storing the value of "RRP", instead of the BulkAttributeRenamer.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings