Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How to create a mapping ?

id date
101 2/4/2008
101 4/4/2008
102 6/4/2008
102 4/4/2008
103 4/4/2008
104 8/4/2008

O/P - shud have only one id with the min(date)
How to create a mapping for this

Answers were Sorted based on User's Feedback



How to create a mapping ? id date 101 2/4/2008 101 4/4/2008 102 6/4/2008 102 4/4/2008 103 4..

Answer / srinu

I think its Simple, with Agg Transformation,
First Group by ID,
Then go with min (date) in same Agg Transformation.

I think its Help you,,,,,,
Any ??? r Corrections,,,Let me know
srinu.srinuvas@gmail.com

Is This Answer Correct ?    21 Yes 11 No

How to create a mapping ? id date 101 2/4/2008 101 4/4/2008 102 6/4/2008 102 4/4/2008 103 4..

Answer / dl

Hi Achoudhr,

here u go,

sq--->agg----->target

In agg dont use group by on any port and take output
columns for both id & date ports, use 'min' function in
outpput expression and connect output ports to desired
target columns.you will get only one output row that is 101
2/4/2008.

note: if u use group by mapping outputs 3 rows.

Is This Answer Correct ?    15 Yes 6 No

How to create a mapping ? id date 101 2/4/2008 101 4/4/2008 102 6/4/2008 102 4/4/2008 103 4..

Answer / mitesh gaur

I think there is no need of using any aggregation. It's very
straight fwd, just sort the data on date and fetch only
first record.
Add the below query to source qualifier's SQL OVERRIDE
and that will be your result - (lets say table name is TmpTab)

select * from (select * from TmpTab order by date) where
rownum = 1;

now connect id, date to target.

Is This Answer Correct ?    9 Yes 5 No

How to create a mapping ? id date 101 2/4/2008 101 4/4/2008 102 6/4/2008 102 4/4/2008 103 4..

Answer / rob

Add the below query to source qualifier's SQL OVERRIDE
and you will get the required output

select * from (select min(to_date(date,'dd/mm/yyyy'))as
d,id from emp
group by id order by d)where rownum =1;

source-->SQualifier(with query)----> target

Is This Answer Correct ?    2 Yes 1 No

How to create a mapping ? id date 101 2/4/2008 101 4/4/2008 102 6/4/2008 102 4/4/2008 103 4..

Answer / parthiban

S->SQ->SRT->EXP->FIL->TGT

Sort on date Column

In Expression, Create variable ports for partition
V_Currdate = date
V_Flag = IIF(V_Currdate = V_Prevdate, V_Flag+1,1)
V_Prevdate =date
O_Flag = V_Flag

In Filter, Filter where O_Flag =1

Is This Answer Correct ?    2 Yes 2 No

How to create a mapping ? id date 101 2/4/2008 101 4/4/2008 102 6/4/2008 102 4/4/2008 103 4..

Answer / azhar

Simple use sql override query:

select top1 * from TABLENAME order by ID,DATE

Is This Answer Correct ?    0 Yes 0 No

How to create a mapping ? id date 101 2/4/2008 101 4/4/2008 102 6/4/2008 102 4/4/2008 103 4..

Answer / deepak

SQ --> Sorter (sort on date desc) --> Aggregator (select no ports so it will always return last row) --> Target

Is This Answer Correct ?    0 Yes 0 No

How to create a mapping ? id date 101 2/4/2008 101 4/4/2008 102 6/4/2008 102 4/4/2008 103 4..

Answer / bidhar

I think you can get this by SQ Override query itself.

SQ->Exp->Target

SQ Override Query:

SELECT ID,MIN(DATE) FROM TABLENAME GROUP BY ID.

Let me know if i am wrong.

Is This Answer Correct ?    2 Yes 4 No

How to create a mapping ? id date 101 2/4/2008 101 4/4/2008 102 6/4/2008 102 4/4/2008 103 4..

Answer / kalyan

I guess the below logic will solve this question..

Sq -> Expression T/R -> Aggr t/r -> Target

Create a constant port in Expression t/r and then pass the 3
fields id, date & const port to the aggregate t/r... Create
a new port calculating mindate.. Now do a group by on the
Const field ; connect id & min Date fields to the Target...

FYI, If u don't apply group by on any column of the table ;
can not calculate the Aggr values...

Please correct me if I am wrong...

Is This Answer Correct ?    1 Yes 7 No

Post New Answer

More Informatica Interview Questions

what is diff between IN and EXIT commands

1 Answers   HCL, Schneider,


One source and 3 targets 1st row-1st target 2nd row-2nd target 3rd row-3rd target 4th row-1ist target how will u do?

5 Answers   HCL,


what is the difference between repository & Intergration service

1 Answers  


How to use pmcmd utility command?

0 Answers  


Explain informatica architecture - version 8 / 9

0 Answers   Informatica,


what is constraint based loading

2 Answers   IBM,


Clarify the aggregator change?

0 Answers  


replace multiple spaces with single space.

3 Answers   IBM,


what are the differences between powercenter 8.1 and powercenter 8.5?

2 Answers  


(Integ) Start workflow: ERROR: User [practice] does not have sufficient privilege for this operation. how to solve this pls suggest me? THANKS in advance

1 Answers  


What is the query to find nth highest salary? What is the use of cursors?

8 Answers   Keane India Ltd,


what is mapping optimization? wat are the techniques for tat

2 Answers  


Categories