Home > Software > Data-Warehouse > Informatica
Interview Questions   Tutorials   Discussions   Programs   

Informatica - I want expect first and last record remaining all records will be loaded into target? which transformations we can use?




465
views
asked marvit September 20, 2014 07:59 AM  

I want expect first and last record remaining all records will be loaded into target? which transformations we can use?


           

1 Answers



 
answered By vishnoiprem   0  
                    Seq
Source--->SQ--->Exp---->Agg--->Joiner--->Filter---->Tgt
 
Exp:
Pass NextVal to Exp.
Create Output port O_Dummy and assign values as 1.
 
Agg:
Connect NextVal from Exp to Agg.
create two output ports as
O_Count : Count(NextVal)
Dummy     :1
dont enable Group by on any column.
 
Joiner:
Enable sorted input
Drag all values from Exp to Joiner.
Drag O_Count ,Dummy   prots from Agg to Joiner.
Join Condition as O_Dummy=Dummy
 
Filter:
Connect all ports from Joiner except O_Dummy and Dummy.
Condition as
NEXTVAL != 1 and NEXTVAL<O_Count
 
Pass the rewired ports from Filter to Target.



If your source is a flat file and server is Unix, there is a very easy way to achieve your scenario using sed utility in unix.
 
At session level in source properties set as below:
 
Input Type >>> Command
Command Type >>> Command Generating Data
Command >>>> sed -e '1d' -e '$d'  src_dir/file.txt
 
1d deletes first line and $d deletes last line.
flag   
   add comment

Your answer

Join with account you already have

FF

Preview


Ready to start your tutorial with us? That's great! Send us an email and we will get back to you as soon as possible!

Alert