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
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 |
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 |
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 |
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 |
Answer / azhar
Simple use sql override query:
select top1 * from TABLENAME order by ID,DATE
| Is This Answer Correct ? | 0 Yes | 0 No |
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 |
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 |
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 |
what is the difference between stop and abort?
My source is flat file which contain only one column with data type varchar.now i want to send string data types into one target and if any numbers and special characters are there that should be send it into another target.so how do you design a mapping for this?
how to read data from website into informatica? plsss send answers ASAP thanks in advance.
hi talents, how do u get sequece numbers with oracle sequence generator function in informatica.... i dont need to use sequence generator transformation..... how do u achieve this???
diffrence between command task and control task
What is Java Transformation? what are the uses of it?
what are objects in data warehouse?
what is the predefined port in dynamic lookup
Change Data Capture in Informatica,using Incremental Aggregation.How can i identify the these data in Target table.
1)can anyone explain how to use Normalizer transformation for the following scenario Source table | Target Table | Std_name ENG MAT ART | Subject Ramesh Himesh Mahesh Ramesh 68 82 78 | ENG 68 73 81 Himesh 73 87 89 | MAT 82 87 79 Mahesh 81 79 64 | ART 78 89 64 | please explain what should be the normalizer column(s) The GCID column 2)Also please explain the Ni-or-1 rule.
5 Answers FCS, IBM, Satyam, TCS,
How does the aggregator transformation handle null values?
in reporting we add some new objects,how we get the count of the newly added objects to the report