Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Complicated transformation (for a noob at least...)

Hi,

I'm new to the talend world and looking for some guidance from you guys. I've read the online tutorials but they mainly address simple cases of tansformation.

I'm not necessarely looking for the exact answer, but more for hints about which Talend componants to dig in so I can solve my problem.

Thank you by advance!

 

So here is my case, simplified.

I have a list of componants belonging to some buildings.

An example, simplified to the strict minimum:

Building_ID; Component_CODE

1 ; CODE1

1 ; CODE2

2 ; CODE2

A building could have several times the same component, it is identified with other fields, not relevant here.

 

Then I have a list of "mandatory componants" in an other file:

Component_CODE

CODE2

CODE3

 

Here is what I need to do, for each buildings in my first file, (Building_ID 1 and 2 in my example) I need to add any missing componant. So in the end this is what it would look like:

 

Building_ID; Component_CODE

1 ; CODE1

1 ; CODE2

1 ; CODE3 (added)

2 ; CODE2

2 ; CODE3 (added)

 

To me there is 2 parts in this problem:

First I need to start by adding a CODE2 (for instance) to every buildings from my first file, that don't already have one.

Then, I need to to the same, but iterating from the mandatory componant list.

 

Today I know a bit about the main Talend components (mainly tMap actually...) and can't see how it could help me with this. I'm currently looking for documentation on Iterator components, but no success so far, though I feel like I should look deeper into them as my problem is about iterating I guess. 

I'm also a Java developper, so I'm not afraid to write some code if it's necessary.

Any hint of components or principles I should look into would be greatly appreciated!

Thank you (Sorry by advance for english mistakes I could make in this post, it's not my main language),

Guillaume

Labels (2)
1 Solution

Accepted Solutions
billimmer
Creator III
Creator III

Maybe try,

 

1. create a list of unique building id's by reading the first file and passing the building id's to tUniqRow.

2. Now full outer join your building id's to your mandatory components list with a tmap

3. Take that result of building mandatory components, with a lookup of your first file in a tmap.  Send records that don't match to a new file.  This new file now holds the missing mandatory items.

View solution in original post

4 Replies
Anonymous
Not applicable
Author

Hi,

Do you guys have any sort of hint? 

Or is Talend not made for this kind of transformation?

billimmer
Creator III
Creator III

Maybe try,

 

1. create a list of unique building id's by reading the first file and passing the building id's to tUniqRow.

2. Now full outer join your building id's to your mandatory components list with a tmap

3. Take that result of building mandatory components, with a lookup of your first file in a tmap.  Send records that don't match to a new file.  This new file now holds the missing mandatory items.

Anonymous
Not applicable
Author

Thank you very much for the method!

I'm going to try it and will let you know how it went.

 

Anonymous
Not applicable
Author

It worked perfectly, and it helped understand a bit more the way of doing things in Talend. Thank you very much!