▹ Rank Transformation is an active transformation which is used to get top / bottom range of data.
▹ Also used to return the largest or smallest numeric values in a group.
▹ The Rank transformation differs from Aggregator transformation, because the Rank transformation returns a group of values, not just one value.
▹ Rank Transformation will work as RANK() analytical function is oracle.
Rank Transformation Properties:
Under Rank Properties you can do the below.
▹ You can give only one column as rank by port.
▹ You can choose rank order as top / bottom
▹ You can choose number of ranks in number of rows property.
The Below example will give Top 5 Salaries in from the Rank Transformation.
Rank transformation will give Default RANKINDEX as an output field. RANKINDEX will give the integer number as per the Rank like below.
RANKINDEX appears on the Incoming Fields tab of the downstream transformation and you can connect to next transformation in the field mapping as like below.
GROUP BY IN RANK TR:
If you select any column as Group by port in Rank Transformation, For Each group of group by port, it will give top/bottom values.
The below example has given, Top 2 salaries in each COUNTRY_ID;
CACHE IN RANK TR:
There are two caches in Rank Transformation. Data Cache and Index Cache.
Data Cache: Data cache that stores row data based on the group by fields.
Index Cache: Index cache that stores group values as configured in the group by fields.
Rank Transformation Example: