Skip to main content

Rank Transformation in Informatica


Active Transformation.

Used to seek the position (at which position the data is).

We can see top or bottom positions.

By default, rank index port name is created along with the transformation object (To carry the rankings – rank index is prepared).


Ports:

Input
Output
Expression
Variable
Rank
Group-By

Steps:
1. Define the Source Definition (EMP).

2. Define the Target Definition.

How to Define the Target Table?



1. Go to Ware House Designer create a target table same as the source (EMP) by dragging and dropping the source definition.

2. Edit EMP source definition. Go to the Table tab of Edit and rename it to DIM_RANK.


Now go to the Columns tab and add a new column RANKINDEX and click Apply, then OK.



Till now the new table Dim_RANK is logically present in the WareHouse. 


SQL> select * from tab;

TNAME                          TABTYPE  CLUSTERID
------------------------------ ------- ----------
DIM_EMP                        TABLE
DIM_EMP1                      TABLE

To make it available physically go to the Targets Menu and click on Generate/Execute SQL.




Click on Connect button.
Give the DSN, Username and Password of the Target.

Click the radio button Generate from Selected Tables , check the box Create Table.
Click Generate SQL file and the Close.



SQL> select * from tab;

TNAME                          TABTYPE  CLUSTERID
------------------------------ ------- ----------
DIM_EMP                        TABLE
DIM_EMP1                       TABLE
DIM_RANK                     TABLE

Note that DIM_RANK now physically belongs to the Schema DWH_MEEN.

Define the mapping by dragging the source and target. Create a RANK Transformation T_RANK.



By default a RANKINDEX column is there in the blank transformation object.



Project the required ports from the Source Qualifier to the transformation object.
Edit Rank Transformation.


Go to the Ports Tab and apply RANK on Salary Check the R box. Apply Group By on the department no. 


Click on Apply and then OK.

Now in the Properties Tab 

Set Top/Botton to Top and Number of Ranks to 2. 

(It will fetch us the top 2 salaries)

RANK also uses CACHE




Now we have selected department wise top two salaries, but our objective is to fetch the second highest salary so we will apply a fliter with the condition RANKINDEX = 2.

Create a Filter Transformation. Project the required ports from RANK to FILTER.
Edit Filter – In the Properties Tab apply the condition RANKINDEX = 2.
Apply -> OK

Project the required ports from the Filter to the Target.
SQ -> T_RANK -> T_FIL -> DIM_RANK.
(To increase the performance, use SORTER Transformation before T_RANK)


Create a Session
Create a Workflow
Repository _> Save
Start Workflow
 
We encounter an error.




Edit the Session.

In the Mappings Tab, select the target DIM_RANK. In the Properties, Set Target Load Type as Normal.
Repository -> Save

Start the Workflow Again.

Now the load is successful.

Comments

  1. how to remove the duplicate record by using rank transformation

    ReplyDelete

Post a Comment

Popular posts from this blog

Contact Me

Do You have any queries ?                   If you are having any query or wishing to get any type of help related Datawarehouse, OBIEE, OBIA, OAC then please e-email on below. I will reply to your email within 24 hrs. If I didn’t reply to you within 24 Hrs., Please be patience, I must be busy in some work. kashif7222@gmail.com

Top 130 SQL Interview Questions And Answers

1. Display the dept information from department table.   Select   *   from   dept; 2. Display the details of all employees   Select * from emp; 3. Display the name and job for all employees    Select ename ,job from emp; 4. Display name and salary for all employees.   Select ename   , sal   from emp;   5. Display employee number and total salary   for each employee. Select empno, sal+comm from emp; 6. Display employee name and annual salary for all employees.   Select empno,empname,12*sal+nvl(comm,0) annualsal from emp; 7. Display the names of all employees who are working in department number 10   Select ename from emp where deptno=10; 8. Display the names of all employees working as   clerks and drawing a salary more than 3000   Select ename from emp where job=’clerk’and sal>3000; 9. Display employee number and names for employees who earn commission   Select empno,ename from emp where comm is not null and comm>0. 10

Informatica sample project

Informatica sample project - 1 CareFirst – Blue Cross Blue Shield, Maryland (April 2009 – Current) Senior ETL Developer/Lead Model Office DWH Implementation (April 2009 – Current) CareFirst Blue Cross Blue Shield is one of the leading health care insurance provided in Atlantic region of United States covering Maryland, Delaware and Washington DC. Model Office project was built to create data warehouse for multiple subject areas including Members, Claims, and Revenue etc. The project was to provide data into EDM and to third party vendor (Verisk) to develop cubes based on data provided into EDM. I was responsible for analyzing source systems data, designing and developing ETL mappings. I was also responsible for coordinating testing with analysts and users. Responsibilities: ·          Interacted with Data Modelers and Business Analysts to understand the requirements and the impact of the ETL on the business. ·          Understood the requirement and develope