Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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
The output you mentioned is what you are expecting
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