One Star

Multiple Columns to one column

Hi there, in my source table "Input" I have two fields "Departure_Port" and "Arrival_Port". I would like to input both of these values to 1 column called "Port" on a table called "Target". This way I can manage the lookup data for other reports from this one table. I have been trying to use the : functionality I read on another post. The formula I tried was Input.Departure_Port:Input.Arrival_Port in the Tmap on the Target table and this did not work. It kept giving me the error "Input.Departure_Port.Input cannot be resolved or is not a field and and error Syntax error on token ":", . expected.
I have tried multiple separators with no luck.
^Thank you very much
7 REPLIES
Four Stars

Re: Multiple Columns to one column

try the tJoin component
One Star

Re: Multiple Columns to one column

I am using the same table and thought there is a good way to combine 2 columns into the same column but not with a concat operation. So in my source table I have:
Col A ColB
value1 value1
value2 valueB
value1 valueD
And my target table would have:
Col A
value1
value2
valueB
valueD
There in no additional lookup table which is what I thought the join was used for.
Four Stars

Re: Multiple Columns to one column

this should be an easy tMap job, read the talend manual/components manual to give you an idea how to do this.
One Star

Re: Multiple Columns to one column

I agree, I thought it might be an easy thing and I very well coul dbe missing something. I will keep researching to see what I am missing. I have worked on this for awhile before I reached out to the community. Thank you for your input.
Seven Stars

Re: Multiple Columns to one column

I think you could either:
-- read the table twice, picking up each column, then combine both flows using tUnite and eliminate the duplicates using tUniqueRow
-- read the table once, concatenate the columns in tMap with a delimiter, tNormalize them to make separate rows and then eliminate the duplicates using tUniqueRow.
Four Stars

Re: Multiple Columns to one column

use tSplitRow for same table

Six Stars

Re: Multiple Columns to one column

Why do you need to repeat Value1 in ColumnA?

Is input_dep_port.Input a calculated field?