How to Load Only the first row and last row from a file to a target file using aggregator

This post describes another way of loading the first and last rows. This time using the aggregator transformation. Please see my previous post if you want to know how to do this using a Rank Transformation.(Using Rank Transformation)

Here we are going to use the default behaviour of the Aggregator transformation to get the last row from the file. In an aggregator if you do not specify any group by port it lets pass only the last row from the complete dataset.

Therefore create two pipelines from the source one to find first row similar to the way we did in the mapping with Rank transformation and second to feed an aggregator without any group by port to get the last row.

Use an Union transformation to combine the two dataflows and connect it to a target.

This will give you the simplest way of finding first and last row from a source file.

Let me know if you need any more information in the comments below.

Join the Conversation

1 Comment

  1. Hi

    Actually i am trying using rank but it does not work properly….I have some doubts ont this..can u please help me

Leave a comment

Your email address will not be published. Required fields are marked *