Skip to main content
Announcements
A fresh, new look for the Data Integration & Quality forums and navigation! Read more about what's changed.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

tMap one to many mapping

Hi ,
Can anybody tell me what is the problem with the below mapping.There is a one to many mapping between these two tables ie for a FacilityId I can have more than one Ratings,but by this mapping Iam getting only one Rating (ratingtypecode,ratingvalue) in my output
Labels (2)
14 Replies
Anonymous
Not applicable
Author

Anybody there ???????
Anonymous
Not applicable
Author

sorry did not notice the o/p file properly .Iam getting the o/p in the below format .But i want the o/p as a single record (Expected o/p is at the bottom.How can i get this format??
Cusip 04C9
MaturityDate 20100630
descript TL A2
payfreq 97208125
issamt 2.25
OUTAMT 0
MTerm Ba3
ticker 97208125
Cusip 04C9
MaturityDate 20100630
descript TL A2
payfreq 97208125
issamt 2.25
OUTAMT 0
STerm BB-
ticker 97208125
Cusip 04C9
MaturityDate 20100630
descript TL A2
payfreq 97208125
issamt 2.25
OUTAMT 0
CiRating 5
ticker 97208125
Expected O/p ::::::::::::::::::::::::::::::::::
Cusip 04C9
MaturityDate 20100630
descript TL A2
payfreq 97208125
issamt 2.25
OUTAMT 0
MTerm Ba3
CiRating 5
STerm BB-
ticker 97208125
Anonymous
Not applicable
Author

Hi
Your request looks like this 1995.

Best regards
shong
Anonymous
Not applicable
Author

Hi Shong
That was my request itself 0683p000009MACn.png .. But that was only for a single table..There is a join between two tables here (a one two many join) ..
Please see my tMap mapping
Thanks
Abrar
_AnonymousUser
Specialist III

Hi shong
Is this mapping possible?
Thanks
Abrar
amaumont
Contributor III

I think you could process your data in two steps :
1)
You extract and put in 3 diffrents files your data and ONE of the fields MTerm, CiRating and CiRating.
Take one fileInput (with N lines in the file), one tMap and three fileOutputs, one output for each field MTerm, CiRating and CiRating.
2)
Then, you read the first file as Main row, and the others as lookups. So, you will be able to merge your commons data and your specific fields.
Take the three files in input of the tMap and connect one output which will contain N/3 lines at end of process.
Don't forget to use a ThenRun connection to separate these two processings.
Maybe someone will have an other idea ?
c0utta
Creator

I agree with amaumont - you will need to pre-process the input file into 3 temporary outputs first. After a ThenRun you'll need to process the 3 outputs and join them on the key column(s). All of this assumes that you only need the columns defined in your output table.
If the size of your data isn't too large, then I'd suggest using the "hidden" components tArray and tArrayIn (please search the forum for information on these). You can then do the whole job "in memory".
Also please remember to be polite in the forum. Expecting an answer within 90 minutes, cross posting and bumping is not considered "forum etiquette".
c0utta
Anonymous
Not applicable
Author

Thanks cOutta/amaumont for your suggestion.
Apologies for getting desperate to get the answer (had to submit POC to my manager about Talend)
I tried to solve this according to the below way
1.I used tFilterRow to filter rows ( I used only two rating types) into two different files.
2.Then used a tMap to map one of these files with the main query result
3.Thought of mapping the second file with the output of the tMap ,but as column names are same ,was not able to map the second file with the tMap o/p.Pls see the attached screen shot
4.Is there a way to map it this ways ??
BTW I think I can use tArray as my data size is very big
Thanks
Abrar
amaumont
Contributor III

Use ThenRun connection to process your job in two steps.