You are on page 1of 10

http://learninformaticaonline.com/infa_int_qns.

htm
Scenario and Solutions

Problem 1 How to load n number of records equally to 4 targets

Sol:

You can do this using the sequence generator and router

Sequence Generator

Use this to generate the record number from 1 to 4

Set following properties


http://learninformaticaonline.com/infa_int_qns.htm
Expression:

Use this to get the next value from Sequence generator

Router:Use this to redirect output to 4 targets based on the group property

Here is the solution mapping

Problem2: How to insert First_Name,Last_Name for below scenario

Source

First_Name Last_Name
Vijay
Jaiswal
Kuldeep
Solanki
Lalsingh
Bharti
Poornaya
Cherukmala
Rajeev
TK
http://learninformaticaonline.com/infa_int_qns.htm

Target (o/p)

First_Name Last_Name
Vijay Jaiswal
Kuldeep Solanki
Lalsingh Bharti
Poornaya Cherukmala
Rajeev TK

Solution:

Option1

You can assign serial number to Source data,then group by serial number and take write to target

Expression

Use expression to assign the same serial number to first_name and last_name
http://learninformaticaonline.com/infa_int_qns.htm

Now data will be as below

Sl First_Name Last_Name

1 Vijay
1 Jaiswal
2 Kuldeep
2 Solanki
3 Lalsingh
3 Bharti
4 Poornaya
4 Cherukmala
5 Rajeev
5 TK

Aggregator

Group by SL.As per aggregator property null values are ignored ,use max or min function to get name
combination
http://learninformaticaonline.com/infa_int_qns.htm

Customer records entered in the OLTP system by different agent as below

First Name Last Name Address Entry_Date


Srini Reddy Cegedim, Bangalore 01-01-2011 10:05
Tarun Tanwar Capgemini, US 01-01-2011 10:15
Devashis Jain Symphony, Bangalore 01-01-2011 10:25
Srini Reddy Cegedim ,Bangalore 01-01-2011 11:20

In Data mart records are loaded on the same date 4:00 PM, records should be loaded as below

First Name Last Name Address Effective date End date


Srini Reddy Cegedim, Bangalore 01-01-2011 14:00:00 01-01-2011 14:00:10
Tarun Tanwar Capgemini, US 01-01-2011 14:00:02
Devashis Jain Symphony, Bangalore 01-01-2011 14:00:05
Srini Reddy Cegedim Pvt Ltd 01-01-2011 14:00:10
,Bangalore

Solution:

If you Use Static Lookup

If you u use static lookup then for srini Reddy only one record will be loaded.Because lookup will return only one value
http://learninformaticaonline.com/infa_int_qns.htm
First Name Last Name Address Effective date End date
Srini Reddy Cegedim, Bangalore 01-01-2011 14:00:00
Tarun Tanwar Capgemini, US 01-01-2011 14:00:02
Dev Jain Symphony, Bangalore 01-01-2011 14:00:05

This can be done using dynamic lookup cache

Configure lookup cache as Dynamic

First Name Last Name Address NewLookupRow


Srini Reddy Cegedim, Bangalore 1
Tarun Tanwar Capgemini, US 1
Dev Jain Symphony, Bangalore 1
Srini Reddy Cegedim Pvt Ltd ,Bangalore 2

User router to route for Insert and Insert Update

Then for Insert and Update strategy to insert

For insert Update use sequence generator to create surrogate key

Use update strategy to end old record with system date

Needs to calculate the contribution to family income

Family ID Person ID Person Name Earning


100 1 Vijay 20000
100 2 Ajay 30000
200 3 Bharat 60000
200 4 Akash 60000
300 5 Sanjay 50000

O/P

Family ID Person ID Person Name %Contribution to family


100 1 Vijay 40
100 2 Ajay 60
200 3 Bharat 50
200 4 Akash 50
300 5 Sanjay 100

Solution:

This can be done this the help of Joiner and Aggregator.

Port Expression Group by


Family_id1 Yes
Sal
Tot_sal Sum(sal)
http://learninformaticaonline.com/infa_int_qns.htm

Use the joiner to join the records based on the family id

Port Master/Detail
Family_id Detail
Tot_Sal Detail
Person_id Master
Family_id Master
Person_name Master
Sal Master

Use the Join condtion

Family_id1=family_id

Use the expression to get the calculation

Port Epression
Contribution (sal/Tot_sal)*100

Here is solution mapping

How to separate the duplicate in 1 target and unique only to another target
1|Piyush|Patra|
2|Somendra|Mohanthy
3|Santhosh|bishoyi
1|Piyush|Patra|
2|Somendra|Mohanthy
http://learninformaticaonline.com/infa_int_qns.htm
O/P
File1
1|Piyush|Patra|
2|Somendra|Mohanthy

File2
3|Santhosh|bishoyi
Solution:

This can be done this the help of Aggregator.


Group by the columns on which you want to decide duplicate or unique

Port Expression Group by


ID Yes
FName Yes
LName Yes
Count count(id)

Use router to split the duplicate and unique

Group Name Group Filter Condition


Duplicate count>1
Default

How to produce normalized output or Convert rows into columns

I/P

ID Month Sales
1 Jan 100
1 Feb 120
1 March 135
2 Jan 110
2 Feb 130
2 March 120
http://learninformaticaonline.com/infa_int_qns.htm
O/P

ID Jan Feb March


1 100 120 135
2 110 130 120

Ans:
Use the aggregator group by ID and use First function
FIRST(AMOUNT, MONTH='JAN')
FIRST(AMOUNT, MONTH='FEB')
FIRST(AMOUNT, MONTH='MAR')

How to produce normalized output or Convert rows into columns

ID Jan Feb March


1 100 120 135
2 110 130 120

O/P

ID Month Sales
1 Jan 100
1 Feb 120
1 March 135
2 Jan 110
2 Feb 130
2 March 120

Sol: This can be done using the normalizer

In Normalizer tab add two ports ID and Sales.for sales put occurs=3
http://learninformaticaonline.com/infa_int_qns.htm

When for sales occurs =3 is given that time in ports sales_in1,sales_in2,sales_in3 will appear.
Connect Jan_sales->sales_in1
Feb_sales->sales_in2
Mar_sales->sales_in3
Use the expresion to identify month
GCID_Sales=GCID_Sales
Month =IIF(GCID_Sales=1,'JAN',IIF(GCID_Sales=2,'FEB','MAR'))

You might also like