Skip to Content

Pivot Transformation – Multiple in Data Services


Here I am not disclosing the business requirement but just want to illustrate with sample job…please have a look….

What is Pivoting ?


Pivot transformation allows us to change how the relationship between rows is displayed. For each value in each pivot column, Data Services produces a row in the output data set. We can create pivot sets to specify more than one pivot columns.

The below is the source file where it has cost center information comprises of monthly transaction values and GRP values for a financial year (12 months).TRX and GRP values are the pivot columns here and will see how the data should converted to 12 rows per cost center comprises of TRX and GRP values in a row.

Note:-

Creation of format files for excel is not covered

Below is the input file data

Create the format for excel work book, drag and drop source file and pivot transform in the work area .Map it to pivot transform as shown below.

Double click the pivot transform,

  • select the non-pivot columns from source and drag it to Non-Pivot Columns section
  • select the first set of Pivot columns(TRX) from pivot transform source fields and drag it to Pivot Columns section and make the pivot set 1.Give the appropriate display values in Data field column and Header column value

  • Add one more pivot set2, select the second set of Pivot columns (GRP) from pivot transform source fields and drag it to Pivot Columns section  and Give the appropriate display values in Data field column and Header column value

Select the target table where the data to be loaded and map it.

            

Validate and execute the job and check the details as follows. There are 3 source records and converted to 12 rows per 1source record. Total we can see 3 x 12 = 36 records.

Hope the example is helpful to understand the usage of Pivot Transform with multiple sets.

To report this post you need to login first.

2 Comments

You must be Logged on to comment or reply to a post.

  1. Former Member

    Hi, How can I do if my excel keeps growing in column for example:

    1 day:

    schedule       TV1             TV2

    1 am – 2 am   1.2             1.3

    3 am – 4 am   1.2             1.3

     

    2 day:

    schedule       TV1             TV2             TV3

    1 am – 2 am   1.2             1.3               1.4

    3 am – 4 am   1.2             1.3               1.4

     

    It will set for day 1:

    TV1    1 am – 2 am      1.2

    TV1   3 am – 4 am       1.2

    TV2   1 am – 2 am       1.3

    TV2   3 am – 4 am       1.3

     

    But for day 2 will not set the new column, I have to manually set this in DS.

     

    I have a pivot transform and it works good!! But the excel could grow in the future… Exists any way to create automatic process?

    Thanks…

     

    (0) 

Leave a Reply