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

How to replace null(empty) string values with earlier row's values

Hi
I've csv input file with 256 columns. Every two rows have the same EntryID. I need to replace on field in second row from first row example:
Input
RowNumber EntryID TAXRateId
1 1 3
2 1 null
3 2 5
4 2 null
5 3 6
6 3 null
Output after Talend job should look like below:
Output
RowNumber EntryID TAXRateId
1 1 3
2 1 3
3 2 5
4 2 5
5 3 6
6 3 6

Input CSV file have all strings value output also required strings. Input and output file schema have 256 columns.
Any idea how to fast build? Possible only with using tmap?
Thanks in advance for any help
Rafal
Labels (3)
5 Replies
Anonymous
Not applicable
Author

hi
have a look at tMemorizeRows.
hope it helps
regards
laurent
Anonymous
Not applicable
Author

kzone Thanks for this info.
I'm trying to use Tmemorizerows and tmap to do this but when I have on tmap this code:
(TAXReclaimCode_tMemorizeRows_1 == null ||
!TAXReclaimCode_tMemorizeRows_1 == null.equals(TAXReclaimCode_tMemorizeRows_1))
? row7.TAXReclaimCode : ""
Talend sending me errors in tmap component.
I'm using string values for this any idea how to fix this.
Kind Regards
Rafal
janhess
Creator II
Creator II

use isnull and not Talend functions.
Anonymous
Not applicable
Author

This not working maybe this code is not good?
The main idea is describe in first post how to code this in tmap object?
Thanks in advance
Rafal
Anonymous
Not applicable
Author

I think this can also be done with a tMap.
inputfile.xls
\
tMap -->output
/
inputfile.xls
make an inner join on entryId
and filter taxRateID on the first input to not null and on the second input to null
then map fields EntryId and TaxRateId from the first input
and map rowNumber from the second input.