Four Stars

Data flow down in Talend

Hi,

I am new to Talend, working on a project where i need to flow the data down from previous transactions.

Please help

Here's an example

 

Input

ID, Rev, Col1, Col2, Col3

1, 1, X1, NULL, X4

1, 2, NULL, NULL, NULL

1, 3, X2, X3, NULL

1, 4, NULL, NULL, NULL

 

Output

ID, Rev, Col1, Col2, Col3

1, 1, X1, NULL, X4

1, 2, X1, NUL, X4

1, 3, X2, X3, X4

1, 4, X2, X3, X4

 

I am struggling to hold the previous row values. Also, this data is for particular id, values flow within the id rows only.

 

Please help

  • Data Integration
1 ACCEPTED SOLUTION

Accepted Solutions
Employee

Re: Data flow down in Talend

You can do this in tMap or in a tJavaRow.  

If the number of columns is not too many, a tJavaRow may be faster.

You will assign the current not null value to a globalMap variable.  Then pull the value from globalMap variable and replace the column value if the column value is null.  If the column value is not null, then maybe you want to overwrite the globalMap variable.

Look at the help for the tJavaRow

 

3 REPLIES
Four Stars

Re: Data flow down in Talend

The output you mentioned is what you are expecting

Four Stars

Re: Data flow down in Talend

Yes, that is what i am expecting..
If id is same and column has no value , the last entry's value should flow down
Employee

Re: Data flow down in Talend

You can do this in tMap or in a tJavaRow.  

If the number of columns is not too many, a tJavaRow may be faster.

You will assign the current not null value to a globalMap variable.  Then pull the value from globalMap variable and replace the column value if the column value is null.  If the column value is not null, then maybe you want to overwrite the globalMap variable.

Look at the help for the tJavaRow