Search This Blog

Tuesday, October 2, 2012

Scenario 3 - Aggregator Transformation Example

Input :

Student NameSubject NameMarks
SamMaths100
TomMaths80
SamPhysical Science80
JohnMaths75
SamLife Science70
JohnLife Science100
JohnPhysical Science85
TomLife Science100
TomPhysical Science85

Output :

Student NameMathsLife SciencePhysical Science
Sam1007080
John7510085
Tom8010085


Answer :

Here the transformation which we have to use is Sorter and Aggregator .

Lets see the approach :

1) The Input from the Source Qualifier is sent into the Sorter transformation , And Sorted based on Student name and Subject.
The following output is obtained
Student NameSubject NameMarks
SamMaths100
SamLife Science70
SamPhysical Science80
JohnMaths75
JohnLife Science100
JohnPhysical Science85
TomMaths80
TomLife Science100
TomPhysical Science85

2) The output from Sorter transformation is sent into the aggregator transformation and Group by Student name is selected . As we need the final output grouped with student name.
And also in the aggregator transformation three columns are created like
1) Maths --- with formula -- Max(Marks, Subject = 'Maths')
2) Life Science --- with formula -- Max(Marks, Subject = 'Life Science')
3) Physical Science --- with formula -- Max(Marks, Subject = 'Physical Science')

3) Now Student name and Maths , Life Science , Physical Science are connected to the target.
The output obtained is as follows :

Student NameMathsLife SciencePhysical Science
Sam1007080
John7510085
Tom8010085


5 comments:

  1. This comment has been removed by a blog administrator.

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. This comment has been removed by a blog administrator.

    ReplyDelete
    Replies
    1. This comment has been removed by the author.

      Delete
  4. This comment has been removed by a blog administrator.

    ReplyDelete

Please Give Your Comments!!

Note: Only a member of this blog may post a comment.