top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Informatica mapping creation

+2 votes
342 views

I need to create an Informatica mapping which can sort data and rank it. There are two tables in two different application so directly I cannot join them in SQL. Both has huge data so need to take care of the performance also. Senario could be like below-

There are two tables Department(DEPT) and Employee(EMP).They have 1(DEPT):M(EMP) relation. Department table has columns (Row_id, DeptNm, Created_date),Employee table has columns (Row_id, EMPName, Emp_num, Par_row_id (FK to DEPT.row_Id),Salary)

For a perticular Department sort data as per employee's decreasing salary and rank it. Data should come in text file as below -

DeptNm |EmpNm  |Salary|Rank
Finance|Vikram |200000|1
Finance|Uttaam |150000|2
Finance|Rajeev |100000|3
ITDPPT |Balaji |150000|1
ITDEPT |Harsha |120000|2
ITDEPT |Weeniji|100000|3
posted Jun 10, 2014 by Sachin

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

2 Answers

0 votes

You can use a joiner transformation to join the department and employee tables. Then use a sorter and rank transformation to rank the rows.

answer Jun 11, 2014 by Shweta Singh
0 votes

Use the Joiner Transformation to join both the tables and then sort the data with respect to DeptNm column. Output will come like -
DeptNm |EmpNm |Salary
Finance |Vikram |200000
Finance |Uttaam |150000
Finance |Rajeev |100000
ITDPPT |Balaji |150000
ITDEPT |Harsha |120000
ITDEPT |Weeniji |100000

Add an EXPRESSION transformation to set a boundary flag for each DeptNm group. In the expression transformation add following ports.
- V_NEW_FLAG as Variable Port
- V_DEPT as Variable Port
- NEW_FLAG as Output Port
- V_COUNT_FLAG as Variable Port
- COUNT_FLAG as Output Port

And the following are the expressions for the ports.
- V_NEW_FLAG :- IIF(DeptNm = V_DEPT, 'N', 'Y')
- V_DEPT :- STATE
- NEW_FLAG :- V_NEW_FLAG
- V_COUNT_FLAG :- IIF(V_NEW_FLAG = 'Y', 1, V_COUNT_FLAG + 1)
- COUNT_FLAG :- V_COUNT_FLAG

answer Jun 11, 2014 by Shatark Bajpai
Similar Questions
+2 votes

If work flow run on informatica level how to create the automatically file create error reocrds and rejected records in one file.

0 votes

Design a mapping to load the first record from a flat file into one table A, the last record from a flat file into table B and the remaining records into table C?

+1 vote

A mapping just take 10 seconds to run, it takes a source file and insert into target, but before that there is a Stored Procedure transformation which takes around 5 minutes to run and gives output ‘Y’ or ‘N’. If Y then continue feed or else stop the feed. (Hint: since SP transformation takes more time compared to the mapping, it shouldn’t run row wise).

0 votes

Suppose if we have duplicate records in a table temp_n. Now I want to pass unique values to t1 and duplicate values to t2 in single mapping? How can we achieve?

...