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

Explain about HLD and LLD ?

16 Answers   Accenture,


How do you load first and last records into target table? How many ways are there to do it? Explain through mapping flows.

0 Answers  


What is a repository manager?

0 Answers  


Can anyone tell me, when a flat file contains different kinds of delimeters available for each line ( For Ex: First line contains [,*&#$] and second line contains [%@$#%^]. Like that all records having different kinds of delimeters. How can we implement this kind of flat file in informatica?

2 Answers  


In Flat file Input is A B C I need output like this A A A B B B C C C. How will u achieve this?

5 Answers   iNautix,






Hi frndz, "while i am going to run the infotmatica power designer,he ask the id and password ",then i enterd the id and passwd , at that time i got the error as " failed to connect repository " ?

3 Answers  


What is workflow? What are the components of the workflow manager?

0 Answers  


What is meant by LDAP users?

0 Answers  


Explain lookup transformation source types in informatica

0 Answers   Informatica,


What is the Rank index port in Rank transformation?

0 Answers   Informatica,


waht is dataware house

2 Answers  


Under what conditions selecting sorted input in aggregator will still not boost session performance?

0 Answers  


Categories