The Sorter Transformation in Informatica is used to sort the source data in either Ascending or Descending order, similar to T-SQL command ORDER BY Statement. In this article we are going to explain the steps involved in configuring the Sorter Transformation in Informatica with example. For this example, we are going to use the below show data
Configure Sorter Transformation in Informatica
Before we start doing anything, First connect to Informatica repository service. In order to connect with Repository service we have to provide the Informatica Admin Console credentials so, Please provide the appropriate Username and Password and click on Connect button as shown below.
TIP: Here you have to provide the Admin Username and password that you specified while installing the Informatica Server.
Step 1: Creating Source Definition
Once you connected successfully, Please navigate to Source Analyzer and define our Sources. In this example, we are using the already created SQL table (Fact Internet Sales) as our source definition. Please refer Database Source in Informatica to understand the steps involved in creating source definition
Step 2: Creating Mapping
In order to create new mapping, Please navigate to Mappings menu in Menu Bar and select the Create.. option. This will open the Mapping Name window as shown below. Here, you have to write unique name for this mapping and click OK button.
TIP: Please refer Informatica Mapping article to understand the steps involved in creating Mapping.
Next, Drag and drop the [Fact Internet Sales] source definition from Sources folder to the mapping designer. Once you drag the source, PowerCenter designer will automatically create the default transformation called source qualifier.
Step 2(a): Creating Sorter Transformation in Informatica
In order to create sorter transformation in informatica, Please navigate to Transformation menu in Menu Bar and select the Create.. option as we shown below.
Once you click on the Create.. option, Create Transformation window will be opened as shown below.
Please click on the arrow to select the required transformation from drop down list. Let us select the Sorter transformation
Next, Please specify the unique name for this transformation and click on Create button
Once you click on the Create button, Sorter transformation will be added to the mapping designer. In order to perform sorting, transformation requires some data so, we have to connect it with Source definition.
Informatica PowerCenter Designer provides multiple ways to connect the source qualifier with the newly created Sorter transformation. For this example, we are right clicking on the empty space and selecting the Autolink.. option from that context menu.
NOTE: Informatica Mapping designer allows us to delete the wrong mapping by selecting the link and deleting it.
From the above screenshot you can observe that, we successfully connected the source qualifier to sorter transformation. Double click on the Sorter transformation to configure the sort properties.
Below window will show you the list of available properties in Transformation tab:
- Select Transformation: By default it will select the transformation you clicked on.
- Rename: This button will help you to rename the sorter transformation to more meaningful name.
- Make Reusable: If you check mark this option then, this transformation will become reusable transformation.
- Description: Please provide the valid description about this transformation.
Below screenshot will show you the list of available options in the Ports tab:.
- Port Name: List of available column names. By clicking the New column button you can add new columns and by clicking the scissors button you can delete the unwanted columns.
- I: Columns that are check marked under this section are the Sorter transformation Input columns.
- O: Columns that are check marked under this section are the Sorter transformation Output columns. If you unchecked any column then, that column will not be available to load in target table.
- Key: Please check mark the Column(s) that you want to use as Sort column. For example, If you want to sort the data by Unit Price and Order Quantity then you have to check mark both of them.
- Direction: Here we have to select the Sort direction. Transformation provides two options: Ascending order (A to Z) and Descending Order(Z to A)
To understand the Sorter Transformation in informatica, we are sorting one column with Ascending order and another with Descending order. From the below screenshot you can observe that, we are sorting the [Sales Amount] in Descending Order
Next, we are sorting the [Freight] in Ascending order. It means,
- First data is sorted by the [Sales Amount] in Descending Order and then
- Second, data will be sorted by the [Freight] in Ascending order.
Click OK to finish configuring the Sorter Transformation in Informatica.
Step 2(b): Target Definition
First, Drag and drop the [Sorter Transformation in Informatica] target definition from Targets folder to the mapping designer. Next, We have to connect the Sorter Transformation with the target definition. Please use the Autolink.. option to connect them.
TIP: Please refer Create Target Table in Informatica article to understand the steps involved in importing the target definition from the SQL Database.
Before we close the Mapping, Let us validate the mapping by going to Mapping Menu bar and selecting the Validate option.
Step 3: Creating Workflow
Once we finish creating the Mapping we have to create the workflow for it. Informatica PowerCenter Workflow manager provides two approaches to create workflow.
In this example we created the Workflow manually. We strictly recommend to refer Informatica Workflow article to understand the steps involved in creating Workflow manually. Once we created the workflow, our next step is to create session.
Step 3(a): Creating Session
There are two types of sessions in informatica:
- Non-reusable Session Task: Please refer Session in Informatica article to understand the steps involved init.
- Reusable Session Task: Please refer Reusable Session in Informatica article to understand the steps involved init.
For this example we are going to create Non-reusable Session. In order to create Non-reusable Session in informatica, Please navigate to Tasks Menu and select the Create option to open the Create Task window. Here you have to select the Session as Task type (default) and enter unique name for the session.
Once you click on the Create button, a new window called Mappings will be opened. Here we have to select the mapping you want to associate with this session. From the below screenshot you can observe that, we are selecting the mapping that we created earlier (in Step 2).
Although we have to configure sources, Target and some common properties, we are explaining only two properties. We strictly recommend to visit Session in Informatica article to understand the remaining properties.
From the below screenshot you can observe that, we changed the Target Load Type option from Bulk to Normal mode and check marked the Truncate target table option to truncate the existing data from the destination table.
From the below screenshot you can observe that, Our informatica workflow is a valid one. Now, Let us start the Informatica Workflow by navigating to Workflows menu and selecting the Start Workflow option.
Once you select the Start Workflow option, Informatica PowerCenter Workflow monitor will be opened to monitor the workflow. From the below screenshot you can observe that, our workflow is executed without any errors.
Let us open the SQL Server Management Studio to check whether we successfully transferred the sort data from Adventure Works DW to the Informatica target database.
Thank You for Visiting Our Blog