Six Stars

How to map column members in Talend

Hi, I have a scenario where I have to map column members from input to output. I.e.

 

ABC (Source_Column) ABC1 (Target_Column)
Plan Actual Plan
Billed To be Billed
  Waived
To Be Billed To Be Billed

 

So what I mean is, for my ABC column if the member is "Plan", in the ABC1, the member should be called as "Actual Plan". If 'Billed', then in ABC1 as To be billed etc. How can I do it..? Is there any good link/tutorial that goes over how to build this logic. Pls help, thanks!

10 REPLIES
Six Stars

Re: How to map column members in Talend

It's very simple
1) Define your source schema on the left hand side
2) Define your target schema on the right hand side
3) simply drag and drop your source column on to your target column you wanted to map.
Please refer to the below tutorial

https://youtu.be/bOxUdictbgc

Note: please do remember spaces are not allowed in the column name while defining the schema anywhere in talend
Thanks
Ashok
Six Stars

Re: How to map column members in Talend

Hi Ashokvv,

 

Thank you for the reply. However I'm not asking for normal column to column mapping. That I understand and I have done it.

 

However, I am asking if my column ABC, has members likes Plan, Billed etc and I want to output the column, but rename the members there i.e. plan changes to 'actual plan', billed to 'to be pilled' etc how do I change it.

 

Six Stars

Re: How to map column members in Talend

Hi kanT

yes I am referring to the same, you can rename the column on the target schema, click on any column name in the schema editor

 

Please see the attached image highlighted in yellow.

 

thanks

Ashok

Six Stars

Re: How to map column members in Talend

Hi Ashokvv,

 

It is not about renaming the column but renaming the members inside that column.

I.e. Column ABC, has 3 members. I have to rename these 3 members in target.

 

 

7.png

 

Six Stars

Re: How to map column members in Talend

Hi KanT

 

You can not rename a source column name (column member) inside the target column if you do so you will loose the mapping between source and target. Perhaps you can map a different source column(s) to that target column. To do that go to mapping editor of the target column, PFA image.

 

thanks

Ashok

Six Stars

Re: How to map column members in Talend

Thanks your response. But by doing this, I am still changing the column name not the name of members inside that column. Pls correct me if I m wrong.

 

 

Seven Stars

Re: How to map column members in Talend

Hi Kant,

 

I think you want to change target value based on source value. If it is then import attached talend job.

I have created routine for this.

 

 

Thanks & Regards
A Ravi Kumar
Mobile Number : +91 852-762-1083
Email-id : a.ravikumar104@gmail.com
Skype Id : ammanannaravikumar
Six Stars

Re: How to map column members in Talend

Hi Ravi,

 

I am very new to talend. Can u please let me know how to import this job in talend. I went to File-> Import-> and select General and selected this folder.and clicked ok.but nothing got populated. can u pls list the steps. Thanks!8.png

Six Stars

Re: How to map column members in Talend

Hi Ravi,

 

I was able to import that job in Talend.

I see you created a tfixedinput_1 column and put the members values in it. But where did u do the mapping to say that Plan maps to Actual Plan, billed to "to be billed"?

10.png

Nine Stars

Re: How to map column members in Talend

Hi KanT,

 

You can try below approach to get desired output.

 

Decode.PNG

 

in tMap: for Target column logic will be 

row2.Details == null || row2.Details=="" ? "Waived":row2.Details.equals("Plan")?"Actual Plan":row2.Details.equals("Billed")?"To be Billed":row2.Details 

Regards,

Veeru Boppudi