Você está na página 1de 3

Active and connected transformation

The Rank transformation allows us to select only the top or bottom rank of data. It Allows us to select a group of top or bottom values, not just one value. During the session, the Power Center Server caches input data until it can perform The rank calculations. Rank Transformation Properties :

Cache Directory where cache will be made. Top/Bottom Rank as per need Number of Ranks Ex: 1, 2 or any number Case Sensitive Comparison can be checked if needed Rank Data Cache Size can be set Rank Index Cache Size can be set

Ports in a Rank Transformation : Ports Number Required Description

1 Minimum

Port to receive data from another transformation. Port we want to pass to other transformation. can use to store values or calculations to use in an expression. Rank port. Rank is calculated according to it. The Rank port is an input/output port. We must link the Rank port to another transformation. Example: Total Salary

1 Minimum

not needed

Only 1

Rank Index The Designer automatically creates a RANKINDEX port for each Rank transformation. The Power Center Server uses the Rank Index port to store the ranking position for Each row in a group. Please make sure that source and target are present.

PowerCenter 7 Level I Developer Lab Guide

8-1

Error! No text of specified style in document.. Error! No text of specified style in document.

source_tgt.sql

Finding Top 2 Salaried Employees for every DEPARTMENT: Creating Mapping: 1. 2. 3. 4. 5. 6. 7. Open folder where we want to create the mapping. Click Tools -> Mapping Designer. Click Mapping-> Create-> Give mapping name. Ex: m_rank_emp_sal Drag EMP from source in mapping. Click Transformation -> Create -> Select RANK from list. Give name and click Create. Now click done. Pull the columns ENAME,SAL,DEPTNO from SQ to Rank Transformation. Edit Rank Transformation. Go to Ports Tab

8. 9.

Select SAL as rank port. Check R type in front of SAL. Select Group By for DEPTNO.

10. Click Properties Tab and Select Properties as needed.

8- 2

PowerCenter 9 Level I Developer Lab Guide

Error! No text of specified style in document.. Error! No text of specified style in document.

11. Top in Top/Bottom and Number of Ranks as 2. 12. Click Apply -> Ok. 13. Drag target table now. 14. Connect the output ports from Rank to target table. 15. Click Mapping -> Validate 16. Repository -> Save

Create Session and Workflow as described earlier. Run the Workflow and see the data in target table. Make sure to give connection information for all tables.

PowerCenter 9 Level I Developer Lab Guide

8-3

Você também pode gostar