Source (Flatfile) - Target (1-1 mapping). How to load first or
last 20 record to target?

Answers were Sorted based on User's Feedback



Source (Flatfile) - Target (1-1 mapping). How to load first or last 20 record to target?..

Answer / joe

We cannot use a sorter because it will shuffle the data.

For the last 20 rows. In a seperate pipeline use aggregator
and do a Count(key) and Max(key) to get the total number of
rows.
use an output port o_count and o_max to populate this count
to an expression transformation before the Filter.

o_count_last_20 = o_count - 20
i.e. if there are 35 records we need records from 15 to 35

In the filter check nextval between o_count_last_20 and
o_Max

Is This Answer Correct ?    3 Yes 0 No

Source (Flatfile) - Target (1-1 mapping). How to load first or last 20 record to target?..

Answer / sunny

Hello joe, your solution is partially correct - what if the
records are not in sequence to do MAX minus 20 ? I guess
this logic can be applied only after passing through
sequence generator, by getting a sequence number.

Is This Answer Correct ?    2 Yes 0 No

Source (Flatfile) - Target (1-1 mapping). How to load first or last 20 record to target?..

Answer / joe

1. Use a sequence generator to associate a NEXTVAL to the
row.

2. Filter condition : NextVal <=20


For source- dbase: Do a filter at SQ by including the
following condition . WHERE Rownum <=20

Is This Answer Correct ?    1 Yes 0 No

Source (Flatfile) - Target (1-1 mapping). How to load first or last 20 record to target?..

Answer / sri

For this you can write SQL query by TOP clause in expression
transformation.
Or else You can use Rank Transformation.

Is This Answer Correct ?    0 Yes 3 No

Source (Flatfile) - Target (1-1 mapping). How to load first or last 20 record to target?..

Answer / raju

You can also achieve using following flow in the mapping.

1)Create an out put port SNO in expression transformation
and connect it to NEXTVAL port in sequence generator
transformation.

2)Use sorter transformation.In sorter ,use SNO port as key
column and Direction is Descending.

3)Use filter transformation with filter condition as
SNO<=20.

Is This Answer Correct ?    0 Yes 3 No

Post New Answer

More Informatica Interview Questions

I've a denormalized table EMP(empno,ename,phone,addr1,addr2,fax,email). Now I want to insert the record into target in the format that, there will be 2 target rows for 1 source record. In target the row needs to be inserted as: ROW1: empno,ename,addr1,phone ROW2: empno,ename,addr2,fax,email And I'm not allowed to normalize transformation. How to achieve?

1 Answers   IBM,


Explain how many types of dimensions are available in informatica?

0 Answers  


how do u move the code from development to production?

3 Answers  


can any one explain me what i have to tell about insurance project in interview,,,,when he asked to tell about ur project

0 Answers  


If a workflow stops or fails after loading 10k records ? How can you recover it and If there is no order while reading data from source ?

2 Answers   IBM, WalMart,






Hi, I am planning to take Infa Certification exam but am unable to find its dumps anywhere on web. If anybody has it, plz share them with me. jkinfo22@gmail.com Thanks in advance

0 Answers  


what kind of issue you will get in environment? (we ll call help desk to raise ticket rite?

0 Answers   TCS,


Why use the lookup transformation ?

2 Answers   Informatica,


How do you load alternate records into different tables through mapping flow?

0 Answers  


How to do unit testing in informatica?

0 Answers  


How do you convert single row from source into three rows into target?

0 Answers  


My Source qualifier has empno, sal. Now my mapping is like SQ(EMPNO)->AGGR->EXP->TARGET SAL ------------>TARGET ? means only one source qualifier has 2 columns like empno, sal. connected to same target as shown in above mapping.Is this mapping valid or any issues are there if we design like this?

2 Answers   Span Systems,


Categories