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

How to display session logs based upon particular dates. If I want to display session logs for 1 week from a particular date how can I do it without using unix. ?

0 Answers   CTS,


Can one use mapping parameter or variables created in one mapping into any other reusable transformation?

0 Answers  


What is a predefined event?

0 Answers  


WHAT IS THE NAME OF THAT PORT IN DYNAMIC CACHE WHICH IS USED FOR INSERT , UPDATE OPRATION ?

4 Answers   Oracle,


why we use informatica in our project?

2 Answers   TCS,






source file name xyz a,0,a,a,a b,b,b,0,b c,c,c,0,c target should be like this xyz a b c how to implement this?

4 Answers   Polaris,


How do you do error handling in Informatica?

1 Answers  


What did you do in source pre load stored procedure

1 Answers  


explain any diffcult scenario that u have faced in your experience... or explain any complex maping u have developed?

0 Answers   TCS, Wipro,


What are slowly changing dimensions?

5 Answers   Informatica, Verinon Technology Solutions,


What are active transformations.

0 Answers  


Hi, source data is col1 values are 5,6,7 col2 are 3,2,1 col3 are 8,9,10 and i want to get target as col1 5,6,7 col2 1,2,3 col3 8,9,10 how to do this one?

6 Answers  


Categories