0% found this document useful (0 votes)
108 views5 pages

Rank Transformation

The Rank Transformation in Informatica allows users to select the top or bottom rows of input data based on a specified ranking port. It is similar to the RANK function in Oracle. The Rank Transformation is an active transformation that changes the number of output rows by filtering on the specified number of top/bottom ranks. When configuring a Rank transformation, users define input/output ports, the ranking port to base the ranking on, whether to rank the top or bottom rows, and the number of ranks to include in the output. The transformation then caches the input data, performs the ranking, and filters the output to only include the specified number of top/bottom ranked rows.

Uploaded by

Mallikarjun Rao
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
108 views5 pages

Rank Transformation

The Rank Transformation in Informatica allows users to select the top or bottom rows of input data based on a specified ranking port. It is similar to the RANK function in Oracle. The Rank Transformation is an active transformation that changes the number of output rows by filtering on the specified number of top/bottom ranks. When configuring a Rank transformation, users define input/output ports, the ranking port to base the ranking on, whether to rank the top or bottom rows, and the number of ranks to include in the output. The transformation then caches the input data, performs the ranking, and filters the output to only include the specified number of top/bottom ranked rows.

Uploaded by

Mallikarjun Rao
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Rank Transformation

Rank Transformation in Informatica, is a connected and active transformation which select top/bottom
rows of input. It is something similar to Rank analytical data function of oracle. Only difference is that, it
also filters out the remaining rows (which are not a part of top/bottom threshold). In below article we
will go through the properties of Rank Transformation, the steps of adding
/configuring Rank transformation in Informatica Mapping.

Scenarios of Rank Transformation:


Rank transformation can be used to filter top /bottom records depending upon as per our need.

How Rank Transformation works in Informatica?


It first caches all the input data and then performs the rank calculation per group, filter out the
unwanted records.

Is Rank Transformation Active or Passive?


Rank Transformation is an active transformation as it is changing the no of output row (by keeping only
top/ bottom records)

Rank Transformation Components


When you configure a Rank transformation, define the following components:
Transformation tab: You can rename the transformation and add a description.
Properties tab: You can specify the tracing level.
Port tab: You can define input/output port here. Variable port can also be created. Most important
port is Rank port which define the basis of ranking

Ports in Rank Transformation:


Ports
I

Number Required
Minimum of one

Minimum of one

Not Required

One only

Description
Input port. Create an input port to receive data from another
transformation.
Output port. Create an output port for each port you want to link to
another transformation. You can designate input ports as output ports.
Variable port. Can use to store values or calculations to use in an
expression. Variable ports cannot be input or output ports. They pass data
within the transformation only.
Rank port. Use to designate the column for which you want to rank values.
You can designate only one Rank port in a Rank transformation. The Rank
port is an input/output port. You must link the Rank port to another
transformation. Example : Salary port in Employee data can be used as

Ranking port

Configuring Rank Transformation Ports:


You can create input ports by copying them from another transformation or by manually creating them
on the Ports tab.

Port Details:

Port name: Add the name of the port.


Datatype, precision, and scale: Configure the datatype and set the precision and scale for each
port.
Default Value: In case port data is null , you can define its default value.

Configuring Rank Transformation Properties:


Modify the Rank Transformation properties by clicking on the Properties tab.
Property
Description
Cache Directory
Local directory where the Integration Service creates the index and data cache files. By
default, the Integration Service uses the directory entered in the Workflow Manager for the
process variable$PMCacheDir. If you enter a new directory, make sure the directory exists
and contains enough disk space for the cache files.
Top/Bottom
Specifies whether you want the top or bottom ranking for a column.
Number of
Number of rows you want to rank.
Ranks
Case-Sensitive
When running in Unicode mode, the Integration Service ranks strings based on the sort
String
order selected for the session. If the session sort order is case sensitive, select this option
Comparison
to enable case-sensitive string comparisons, and clear this option to have the Integration
Service ignore case for strings.If the sort order is not case sensitive, theIntegration
Service ignores this setting. By default, this option is selected.
Tracing Level
Amount of detail displayed in the session log for this transformation. The options are Terse,
Normal, Verbose Data, and Verbose Initialization.Default value : Normal.
Rank Data Cache Data cache size for the transformation. Default is 2,000,000 bytes. If the total configured
Size
session cache size is 2 GB (2,147,483,648 bytes) or more, you must run the session on a 64bit Integration Service. You can configure a numeric value, or you can configure the
Integration Service to determine the cache size at runtime.If you configure the Integration
Service to determine the cache size, you can also configure a maximum amount of memory
for the
Integration Service to allocate to the cache.
Rank Index
Index cache size for the transformation. Default is 1,000,000 bytes. If the total configured
Cache Size
session cache size is 2 GB (2,147,483,648 bytes) or more, you must run the session on
a 64-bit Integration Service. You can configure a numeric value, or you can configure the
Integration Service to determine the cache size at run time .If you configure theIntegration

Transformation
Scope

Service to determine the cache size, you can also configure a maximum amount of memory
for the Integration Service to allocate to the cache.
Specifies how the Integration Service applies the transformation logic to incoming data:
Transaction : Applies the transformation logic to all rows in a transaction. Choose
Transaction when a row of data depends on all rows in the same transaction, but does not
depend on rows in other transactions.
All Input : Applies the transformation logic on all incoming data. When you choose All
Input, thePowerCenter drops incoming transaction boundaries. Choose All Input when a
row of data depends on all rows in the source.

Rank Transformation Example


Problem Statement:
Create a mapping to load the target table with top 2 incomes (employees) in each department with the
help of Rank Transformation.

Solution:

Create a new table in te target database:


Create Table TARGET.EMPLOYEES_RANK (
EMPLOYEE_ID DECIMAL(6,0) Not Null,
FIRST_NAME VARCHAR2(20),
LAST_NAME VARCHAR2(25) Not Null,
EMAIL VARCHAR2(25) Not Null,
PHONE_NUMBER VARCHAR2(20),
HIRE_DATE DATE Not Null,
JOB_ID VARCHAR2(10) Not Null,
SALARY DECIMAL(8,2),
COMMISSION_PCT DECIMAL(2,2),
MANAGER_ID DECIMAL(6,0),
DEPARTMENT_ID DECIMAL(4,0),
rank_no decimal (2,0))
Create a new mapping m_Employees_Rank by Go to toolbar -> click mapping-> Create
Drag the source (HR.EMPLOYEES) and Target Definition (TARGET.EMPLOYEES_RANK) into
the mapping
Add Rank Transformation by Go to Toolbar->click Transformation -> Create. Select the Rank
transformation

Enter the name rnk_Sal_by_dept and click Done.


Drag all the port from Source Qualifier to Rank transformation

Check the Group By option for the Department_ID port.


Also check the Rank option for Salary port.

In properties Tab, select Top in Top/Bottom tab and 2 as Number of Ranks.

Now link all required port from rnk_Sal_by_dept to Employees_Rank Target Definition,

Click on Mapping ( from tool bar) -> then Validate ( to validate the mapping)
Now save the mapping ( by clicking on Repository-> Save or you can also press Ctrl+S)
Generate the workflow and run it

You might also like